π‘οΈ Sentinel: [보μ κ°μ ] base-uri CSP κ°ν (base-uri 'none') - #99
π‘οΈ Sentinel: [보μ κ°μ ] base-uri CSP κ°ν (base-uri 'none')#99seonghobae wants to merge 1 commit into
Conversation
`index.html`μ Content Security Policyμμ `base-uri` μμ±μ `'self'`μμ `'none'`μΌλ‘ λ³κ²½νμμ΅λλ€. μ΄λ₯Ό ν΅ν΄ base νκ·Έ μ½μ 곡격μ μμ²μ μΌλ‘ μ°¨λ¨ν©λλ€. ν΄λΉ λ³κ²½μ κ²μ¦νκΈ° μν νκ· ν μ€νΈ(`test_index_security.py`)λ μΆκ°νμμ΅λλ€.
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
Tightens the static siteβs CSP in index.html by locking down base-uri to prevent <base>-tag injectionβbased URL/path hijacking, and adds a regression test to ensure the policy stays strict over time.
Changes:
- Update
index.htmlCSP frombase-uri 'self'tobase-uri 'none'. - Add a pytest regression test asserting the main page declares a strict
base-uri. - Document the security learning/prevention note in
.jules/sentinel.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
index.html |
Tightens CSP by setting base-uri 'none' for stronger default hardening. |
tests/test_index_security.py |
Adds a regression test to detect CSP regressions for base-uri. |
.jules/sentinel.md |
Records the security rationale and prevention guidance for future changes. |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assert match is not None, "index.html must declare a CSP meta policy" | ||
| policy = match.group(1) | ||
| assert "base-uri 'none'" in policy |
|
Closing as already implemented on |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
π¨ Severity: MEDIUM
π‘ Vulnerability:
index.htmlμ CSP μ€μ μμbase-uriκ°'self'λ‘ μ€μ λμ΄ μμ΄ λΆνμνκ² λμ κΆνμ΄ λΆμ¬λμμ΅λλ€. μ΄ μ±μ<base>νκ·Έλ₯Ό μ¬μ©νμ§ μμ΅λλ€.π― Impact:
<base>νκ·Έ μ½μ μ·¨μ½μ μ ν΅ν κ²½λ‘ λ° URL νμ΄μ¬νΉ μνμ΄ μ‘΄μ¬νμ΅λλ€.π§ Fix: CSPμ
base-uriμ§μμ΄λ₯Ό'none'μΌλ‘ λ³κ²½νκ³ , κ΄λ ¨ κ²μ¦ ν μ€νΈλ₯Ό μΆκ°νμ΅λλ€.β Verification:
λͺ λ Ήμ ν΅ν΄ λͺ¨λ ν μ€νΈκ° ν΅κ³Όνλμ§ νμΈν μ μμ΅λλ€.
PR created automatically by Jules for task 2539522658319416106 started by @seonghobae