Skip to content

πŸ›‘οΈ Sentinel: CSP의 unsafe-inline 제거 및 nonce μ μš©μ„ ν†΅ν•œ λ³΄μ•ˆ κ°•ν™”#120

Open
seonghobae wants to merge 3 commits into
masterfrom
sentinel/csp-improvement-18369353024831413462
Open

πŸ›‘οΈ Sentinel: CSP의 unsafe-inline 제거 및 nonce μ μš©μ„ ν†΅ν•œ λ³΄μ•ˆ κ°•ν™”#120
seonghobae wants to merge 3 commits into
masterfrom
sentinel/csp-improvement-18369353024831413462

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

πŸ›‘οΈ Sentinel: [HIGH] Fix XSS Vulnerability in Auto-generated HTML

🚨 Severity: HIGH
πŸ’‘ Vulnerability: μƒμ„±λ˜λŠ” HTML의 Content-Security-Policy(CSP)에 style-src 'unsafe-inline'이 ν¬ν•¨λ˜μ–΄ μžˆμ–΄ μ•…μ˜μ μΈ μŠ€νƒ€μΌ μΈμ μ…˜μ„ ν†΅ν•œ XSS 곡격의 μ—¬μ§€κ°€ μžˆμ—ˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ style="..." ν˜•νƒœμ˜ 인라인 μŠ€νƒ€μΌμ„ μ‚¬μš©ν•˜κ³  μžˆμ—ˆμŠ΅λ‹ˆλ‹€.
🎯 Impact: κ³΅κ²©μžκ°€ μ‘°μž‘λœ 파일 μ΄λ¦„μ΄λ‚˜ ꡬ쑰λ₯Ό 톡해 μ‚¬μš©μžμ˜ λΈŒλΌμš°μ €μ—μ„œ μž„μ˜μ˜ μŠ€ν¬λ¦½νŠΈλ‚˜ μŠ€νƒ€μΌμ„ μ‹€ν–‰ν•  κ°€λŠ₯성이 μžˆμ—ˆμŠ΅λ‹ˆλ‹€.
πŸ”§ Fix:

  1. java.util.UUIDλ₯Ό ν™œμš©ν•΄ HTML λ Œλ”λ§ μ‹œ κ³ μœ ν•œ nonce 값을 λ™μ μœΌλ‘œ μƒμ„±ν•˜λ„λ‘ λ³€κ²½ν–ˆμŠ΅λ‹ˆλ‹€.
  2. unsafe-inline을 CSPμ—μ„œ μ œκ±°ν•˜κ³  nonceλ₯Ό μ μš©ν–ˆμŠ΅λ‹ˆλ‹€.
  3. κΈ°μ‘΄ 인라인 μŠ€νƒ€μΌμ„ CSS 클래슀(.link-item, .empty-msg)둜 λ³€κ²½ν•˜μ—¬ λ³΄μ•ˆ 정책을 μ€€μˆ˜ν•˜κ²Œ ν–ˆμŠ΅λ‹ˆλ‹€.
    βœ… Verification: ./gradlew test jacocoTestReportλ₯Ό μ‹€ν–‰ν•˜μ—¬ 100% ν…ŒμŠ€νŠΈ 컀버리지λ₯Ό κ²€μ¦ν•˜μ˜€μœΌλ©°, MainTest.ktμ—μ„œ μƒˆλ‘œ λ„μž…λœ nonce 및 CSS 클래슀λ₯Ό κ²€μ‚¬ν•˜λ„λ‘ μ—…λ°μ΄νŠΈν–ˆμŠ΅λ‹ˆλ‹€.

PR created automatically by Jules for task 18369353024831413462 started by @seonghobae

- HTML 생성 μ‹œ XSS 취약점을 λ°©μ§€ν•˜κΈ° μœ„ν•΄ Content-Security-Policy(CSP)μ—μ„œ 'unsafe-inline'을 제거.
- <style> νƒœκ·Έμ— λ™μ μœΌλ‘œ μƒμ„±λ˜λŠ” μž„μ˜μ˜ nonce 속성을 μΆ”κ°€ν•˜μ—¬ μ—„κ²©ν•œ 인라인 μŠ€νƒ€μΌ μ •μ±… 적용.
- 기쑴의 인라인 μŠ€νƒ€μΌ 속성(style="...")듀을 CSS 클래슀(.link-item, .empty-msg)둜 μΆ”μΆœν•˜μ—¬ CSP μ€€μˆ˜.
- MainTest.kt에 CSP와 nonce 검증을 μœ„ν•œ ν…ŒμŠ€νŠΈ μΌ€μ΄μŠ€ μ—…λ°μ΄νŠΈ.
@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.

- HTML 생성 μ‹œ XSS 취약점을 λ°©μ§€ν•˜κΈ° μœ„ν•΄ Content-Security-Policy(CSP)μ—μ„œ 'unsafe-inline'을 제거.
- <style> νƒœκ·Έμ— λ™μ μœΌλ‘œ μƒμ„±λ˜λŠ” μž„μ˜μ˜ nonce 속성을 μΆ”κ°€ν•˜μ—¬ μ—„κ²©ν•œ 인라인 μŠ€νƒ€μΌ μ •μ±… 적용.
- 기쑴의 인라인 μŠ€νƒ€μΌ 속성(style="...")듀을 CSS 클래슀(.link-item, .empty-msg)둜 μΆ”μΆœν•˜μ—¬ CSP μ€€μˆ˜.
- MainTest.kt에 CSP와 nonce 검증을 μœ„ν•œ ν…ŒμŠ€νŠΈ μΌ€μ΄μŠ€ μ—…λ°μ΄νŠΈ.
- HTML 생성 μ‹œ XSS 취약점을 λ°©μ§€ν•˜κΈ° μœ„ν•΄ Content-Security-Policy(CSP)μ—μ„œ 'unsafe-inline'을 제거.
- <style> νƒœκ·Έμ— λ™μ μœΌλ‘œ μƒμ„±λ˜λŠ” μž„μ˜μ˜ nonce 속성을 μΆ”κ°€ν•˜μ—¬ μ—„κ²©ν•œ 인라인 μŠ€νƒ€μΌ μ •μ±… 적용.
- 기쑴의 인라인 μŠ€νƒ€μΌ 속성(style="...")듀을 CSS 클래슀(.link-item, .empty-msg)둜 μΆ”μΆœν•˜μ—¬ CSP μ€€μˆ˜.
- MainTest.kt에 CSP와 nonce 검증을 μœ„ν•œ ν…ŒμŠ€νŠΈ μΌ€μ΄μŠ€ μ—…λ°μ΄νŠΈ.
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