Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,8 @@
**Vulnerability:** ์ •์  HTML ์ƒ์„ฑ ๋„๊ตฌ์—์„œ ๋งค๋ฒˆ ๋‹ค๋ฅธ Nonce๋ฅผ ๋™์ ์œผ๋กœ ์ƒ์„ฑํ•˜์—ฌ CSP์— ์ ์šฉํ•˜๋Š” ๊ฒƒ์€, ์บ์‹ฑ ํšจ์œจ์„ ์ €ํ•˜์‹œํ‚ฌ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ์ •์  ๋ฐฐํฌ ํ™˜๊ฒฝ(์˜ˆ: GitHub Pages ๋“ฑ)์—์„œ ์˜ฌ๋ฐ”๋ฅธ ๋ณด์•ˆ ์ •์ฑ… ์ˆ˜๋ฆฝ์„ ๋ฐฉํ•ดํ•  ์ˆ˜ ์žˆ๋Š” ์•ˆํ‹ฐ ํŒจํ„ด์ž…๋‹ˆ๋‹ค.
**Learning:** ์ •์ ์œผ๋กœ ๊ณ ์ •๋œ ์ธ๋ผ์ธ ์Šคํƒ€์ผ์ด๋‚˜ ์Šคํฌ๋ฆฝํŠธ์—๋Š” ๋‚œ์ˆ˜ํ™”๋œ Nonce๋ณด๋‹ค ์ฝ˜ํ…์ธ  ์ž์ฒด์˜ ํ•ด์‹œ(SHA-256 ๋“ฑ)๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์•ˆ์ „ํ•˜๊ณ  ์ผ๊ด€๋œ ๋ฐฉ์‹์ž„์„ ๋ฐฐ์› ์Šต๋‹ˆ๋‹ค.
**Prevention:** ์ž๋™ ์ƒ์„ฑ๋˜๋Š” ์ •์  HTML์˜ ์ฝ˜ํ…์ธ  ๋ณด์•ˆ ์ •์ฑ…(CSP)์—๋Š” `style-src 'sha256-<HASH>'` ๋ฐฉ์‹์„ ์ ์šฉํ•˜๊ณ , `<style>` ํƒœ๊ทธ์—์„œ ๋ถˆํ•„์š”ํ•œ `nonce` ์†์„ฑ์„ ์ œ๊ฑฐํ•˜์—ฌ ๋ธŒ๋ผ์šฐ์ €์˜ ๋ฌด๊ฒฐ์„ฑ ๊ฒ€์ฆ ๊ธฐ๋Šฅ์„ ์ ๊ทน ํ™œ์šฉํ•˜์‹ญ์‹œ์˜ค.

## 2026-07-30 - [MEDIUM] Kotlin ๋‹ค์ค‘ํ–‰ ๋ฌธ์ž์—ด ํ˜•์‹์˜ ๊ณต๋ฐฑ์œผ๋กœ ์ธํ•œ CSP ์Šคํƒ€์ผ ํ•ด์‹œ ๋ถˆ์ผ์น˜ ๋ณด์•ˆ ๋ฌธ์ œ ์ˆ˜์ •
**Vulnerability:** ์ธ๋ผ์ธ ์Šคํƒ€์ผ CSP (Content-Security-Policy) ์šฐํšŒ ๊ฐ€๋Šฅ์„ฑ
**Learning:** ๋ธŒ๋ผ์šฐ์ €๋Š” ์ธ๋ผ์ธ ์Šคํฌ๋ฆฝํŠธ์™€ ์Šคํƒ€์ผ์˜ ๋‚ด๋ถ€ ํ…์ŠคํŠธ ์ „์ฒด(๊ณต๋ฐฑ ํฌํ•จ)๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ CSP ํ•ด์‹œ๋ฅผ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค. Kotlin์˜ ๋‹ค์ค‘ํ–‰ ๋ฌธ์ž์—ด(`\"\"\"`)์„ ์‚ฌ์šฉํ•˜์—ฌ ์ฝ˜ํ…์ธ ๋ฅผ ์ฃผ์ž…ํ•  ๋•Œ, ์•ž๋’ค์˜ ๋“ค์—ฌ์“ฐ๊ธฐ๋‚˜ ์ƒˆ ์ค„๊ณผ ๊ฐ™์€ ์•”์‹œ์  ๊ณต๋ฐฑ์ด ์ตœ์ข… ์ถœ๋ ฅ ๋ฌธ์ž์—ด์„ ๋ณ€๊ฒฝ์‹œ์ผœ ์‹ค์ œ ์ƒ์„ฑ๋œ ํ•ด์‹œ์™€ ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ์ธ์‹ํ•˜๋Š” ํ•ด์‹œ ๊ฐ„์— ๋ถˆ์ผ์น˜๋ฅผ ๋ฐœ์ƒ์‹œํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋กœ ์ธํ•ด ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ์˜๋„ํ•œ ๋ณด์•ˆ ์Šคํƒ€์ผ์ด๋‚˜ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ๊ฑฐ๋ถ€ํ•˜๊ฑฐ๋‚˜ CSP๊ฐ€ ์ œ๋Œ€๋กœ ๋™์ž‘ํ•˜์ง€ ์•Š๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
**Prevention:** ์ •์ ์œผ๋กœ ๊ณ ์ •๋œ ์Šคํƒ€์ผ์ด๋‚˜ ์Šคํฌ๋ฆฝํŠธ ๋‚ด์šฉ์„ ๋‹ค์ค‘ํ–‰ ๋ฌธ์ž์—ด๋กœ ์ •์˜ํ•  ๋•Œ ๋ฐ˜๋“œ์‹œ `.trimIndent()`๋ฅผ ์ ์šฉํ•˜์—ฌ ์•”๋ฌต์ ์ธ ๋“ค์—ฌ์“ฐ๊ธฐ๋ฅผ ์ œ๊ฑฐํ•˜์‹ญ์‹œ์˜ค. ๋˜ํ•œ HTML ๋‚ด์— ์ด๋ฅผ ์ฃผ์ž…ํ•  ๋•Œ ๋ถˆํ•„์š”ํ•œ ํŒจ๋”ฉ์ด ์ถ”๊ฐ€๋˜์ง€ ์•Š๋„๋ก ํƒœ๊ทธ ์•ˆ์— ์ •ํ™•ํžˆ ์ฃผ์ž…(์˜ˆ: `<style>${exactStyleContent}</style>`)ํ•˜์—ฌ ์™„๋ฒฝํ•œ ํ•ด์‹œ ์ผ์น˜๋ฅผ ๋ณด์žฅํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
Comment on lines +87 to +90

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿ”’ Security & Privacy | ๐ŸŸก Minor | โšก Quick win

๊ณต๋ฐฑ ๋ถˆ์ผ์น˜๋ฅผ โ€œCSP ์šฐํšŒโ€๋กœ ๋ถ„๋ฅ˜ํ•˜์ง€ ๋งˆ์„ธ์š”.

์ด ๋ณ€๊ฒฝ์—์„œ ์„ค๋ช…ํ•œ ํ•ด์‹œ ๋ถˆ์ผ์น˜๋Š” ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ์ธ๋ผ์ธ ์Šคํƒ€์ผ์„ ๊ฑฐ๋ถ€ํ•ด ๋ Œ๋”๋ง ์˜ค๋ฅ˜๋ฅผ ์ผ์œผํ‚ค๋Š” ๋ฌธ์ œ์ด์ง€, ๊ทธ ์ž์ฒด๋กœ CSP ์šฐํšŒ๋ฅผ ํ—ˆ์šฉํ•˜๋Š” ๋ฌธ์ œ๋Š” ์•„๋‹™๋‹ˆ๋‹ค. ๋ณ„๋„์˜ ์šฐํšŒ ๊ทผ๊ฑฐ๊ฐ€ ์—†๋‹ค๋ฉด ์ทจ์•ฝ์  ์„ค๋ช…์„ โ€œCSP ํ•ด์‹œ ๋ถˆ์ผ์น˜๋กœ ์ธํ•œ ์Šคํƒ€์ผ ์ ์šฉ ๊ฑฐ๋ถ€/๋ Œ๋”๋ง ์˜ค๋ฅ˜โ€๋กœ ์ˆ˜์ •ํ•˜์„ธ์š”.

๐Ÿค– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.jules/sentinel.md around lines 87 - 90, Update the 2026-07-30 entry in
sentinel.md to remove the โ€œCSP ์šฐํšŒ ๊ฐ€๋Šฅ์„ฑโ€ vulnerability classification and describe
the issue as CSP hash mismatch causing inline styles to be rejected and
rendering failures. Preserve the existing explanation of whitespace handling and
prevention guidance, but avoid implying a security bypass without separate
evidence.

7 changes: 2 additions & 5 deletions src/main/kotlin/html4tree/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,11 @@ fun process_dir(curr_dir: File, excludeSet: Set<String>? = null, dirFiles: Array
opacity: 0.7;
font-style: italic;
}
"""
""".trimIndent()

val styleHash = "sha256-" + Base64.getEncoder().encodeToString(MessageDigest.getInstance("SHA-256").digest(cssContent.toByteArray(Charsets.UTF_8)))

val css = """
<style>
${cssContent} </style>
"""
val css = "<style>${cssContent}</style>"

val index_top = """<!doctype html>
<html lang="ko">
Expand Down
Loading