π‘οΈ Sentinel: [보μ κ°μ ] index.htmlμ κΈ°λ³Έ CSP κ°λ μν₯#94
π‘οΈ Sentinel: [보μ κ°μ ] index.htmlμ κΈ°λ³Έ CSP κ°λ μν₯#94seonghobae wants to merge 1 commit into
Conversation
index.htmlμ Content-Security-Policy(CSP)λ₯Ό `default-src 'self'` κΈ°λ°μμ μ격ν νμ© λͺ©λ‘(Allowlist) λ°©μμΈ `default-src 'none'`μΌλ‘ κ°ννμ΅λλ€. νμν 리μμ€(script, style, img, font, connect)μ λν΄μλ§ `'self'`λ₯Ό λͺ μμ μΌλ‘ νμ©νκ³ , μ μ¬μ 곡격 벑ν°λ₯Ό μ€μ΄κΈ° μν΄ `base-uri 'none'`κ³Ό `frame-src 'none'`μ μ€μ νμ΅λλ€.
|
π 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. |
π¨ Severity: ENHANCEMENT
π‘ Vulnerability:
κΈ°μ‘΄
index.htmlμ CSPλdefault-src 'self'λ₯Ό μ¬μ©νκ³ μμ΄, μλμΉ μκ² κ°μ μΆμ²(Origin)μ λ€λ₯Έ 리μμ€(μ: iframe, object λ±)κ° λ‘λλ κ°λ₯μ±μ μ΄μ΄λμ΄ κ³΅κ²© νλ©΄(Attack Surface)μ΄ λΆνμνκ² λμμ΅λλ€.π― Impact:
λ§μ½ μ μ νμΌ μ 곡μ μ·¨μ½μ μ΄ λ°μνκ±°λ μμμΉ λͺ»ν νμΌμ΄ μ λ‘λλμμ κ²½μ°,
default-src 'self'λ μ΄λ¬ν 리μμ€λ€μ΄ λ‘λλλλ‘ νμ©νμ¬ μ μ¬μ μΈ κ³΅κ²© 벑ν°(UI Redressing, Base Tag Injection λ±)λ‘ μ μ©λ μ μμ΅λλ€.π§ Fix:
CSPλ₯Ό μ격ν νμ΄νΈλ¦¬μ€νΈ λ°©μμΈ
default-src 'none'μΌλ‘ λ³κ²½νκ³ , λμμ λ°λμ νμν 리μμ€(script-src 'self',style-src 'self',img-src 'self',font-src 'self',connect-src 'self')λ§ λͺ μμ μΌλ‘ νμ©νμ΅λλ€. λνbase-uri 'none'κ³Όframe-src 'none'μ μ€μ νμ¬ λΆνμν νκ·Έ λ° νλ μ λ‘λ©μ μ°¨λ¨νμ΅λλ€.β Verification:
tests/test_index_security.pyνκ· ν μ€νΈλ₯Ό μΆκ°νμ¬ CSPκ° μ격ν νμ΄νΈλ¦¬μ€νΈ λ°©μ(default-src 'none')μΌλ‘ μ€μ λμ΄ μκ³unsafe-inline,unsafe-evalμ΄ ν¬ν¨λμ§ μμμμ κ²μ¦νμ΅λλ€.python3 -m pytest tests/λͺ λ ΉμΌλ‘ μ 체 ν μ€νΈ μ€μνΈκ° ν΅κ³Όνλμ§ νμΈνμ΅λλ€ (μ΄ 11κ° ν μ€νΈ ν΅κ³Ό).PR created automatically by Jules for task 1161550063132055018 started by @seonghobae