π‘οΈ Sentinel: [MEDIUM] CSP 보μ κ°ν (Nonce λμ λ° μΈλΌμΈ μ€νμΌ μ κ±°)#111
Conversation
- `unsafe-inline`μ μ κ±°νκ³ λ¬΄μμ Nonce(λμ€)λ₯Ό μ¬μ©ν κ°λ ₯ν μ€νμΌ CSP μ μ© - κΈ°μ‘΄ μΈλΌμΈ μ€νμΌμ CSS ν΄λμ€ `.item-link` λ° `.empty-msg`λ‘ λΆλ¦¬ - HTML ν νλ¦Ώμ XSS λ°©μ΄ κ³μΈ΅(Defense in Depth) κ°ν - κ΄λ ¨ `MainTest.kt` ν μ€νΈ μ½λ μ λ°μ΄νΈ μλ£
|
π 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. |
π¨ μ¬κ°λ: MEDIUM
π‘ μ·¨μ½μ : μ μ μμ±λ HTML λ¬Έμ λ΄μ λμ¨ν
Content-Security-Policy(CSP) μ μ© (style-src 'unsafe-inline'). μ΄λ μΆκ°μ μΈ λ³΄μ κ³μΈ΅μ μ½νμν΅λλ€.π― μν₯: 곡격μκ° μ΄λ ν λ°©μ(μ: μ·¨μ½μ μ ν΅ν μμ± μ£Όμ )μΌλ‘λ μν₯μ λ―ΈμΉ μ μκ² λ κ²½μ°, μΈλΌμΈ μ€ν¬λ¦½νΈλ μ€νμΌμ μ½μ νμ¬ μ μμ μΈ νμ(XSS)λ‘ μ΄μ΄μ§ μνμ΄ μ‘΄μ¬ν©λλ€.
π§ ν΄κ²°μ± :
java.security.SecureRandomλ°Base64μΈμ½λ©μ μ¬μ©νμ¬ λ λλ§ μλ§λ€ μμΈ‘ λΆκ°λ₯ν μνΈνμ λμ€(Nonce)λ₯Ό μμ±νκ³style-srcμ μ± μ μ μ©νμ΅λλ€. μ΄λ₯Ό μν΄ HTML λ΄<a>νκ·Έμ<div>νκ·Έμ μ μ©λμ΄ μλ μΈλΌμΈ μ€νμΌ μμ±μ μ κ±°νκ³ λ³λμ CSS ν΄λμ€(.item-link,.empty-msg)λ‘ μΆμννμμ΅λλ€.β κ²μ¦ λ°©λ²:
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 ./gradlew test jacocoTestReport --continueλͺ λ Ήμ΄λ₯Ό μ¬μ©νμ¬ λͺ¨λ ν μ€νΈ(νΉν CSP ν€λλ₯Ό κ²μ¬νλMainTest)κ° μ μμ μΌλ‘ ν΅κ³Όλ¨μ νμΈνμ΅λλ€. 100% ν μ€νΈ 컀λ²λ¦¬μ§λ₯Ό μ μ§ν©λλ€.PR created automatically by Jules for task 1159183887386254927 started by @seonghobae