Skip to content

πŸ›‘οΈ Sentinel: [λ³΄μ•ˆ κ°œμ„ ] index.html의 κΈ°λ³Έ CSP 강도 상ν–₯#94

Open
seonghobae wants to merge 1 commit into
mainfrom
sentinel/strict-index-csp-1161550063132055018
Open

πŸ›‘οΈ Sentinel: [λ³΄μ•ˆ κ°œμ„ ] index.html의 κΈ°λ³Έ CSP 강도 상ν–₯#94
seonghobae wants to merge 1 commit into
mainfrom
sentinel/strict-index-csp-1161550063132055018

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

🚨 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

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'`을 μ„€μ •ν–ˆμŠ΅λ‹ˆλ‹€.
@google-labs-jules

Copy link
Copy Markdown

πŸ‘‹ 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant