Skip to content

๐Ÿ›ก๏ธ Sentinel: [๋ณด์•ˆ ๊ฐœ์„ ] ๋ฉ”์ธ ํŽ˜์ด์ง€ CSP ๊ฐ•ํ™” ๋ฐ ๊ฒ€์ฆ ํ…Œ์ŠคํŠธ ์ถ”๊ฐ€#97

Open
seonghobae wants to merge 1 commit into
mainfrom
sentinel-strict-csp-main-10918979539190325931
Open

๐Ÿ›ก๏ธ Sentinel: [๋ณด์•ˆ ๊ฐœ์„ ] ๋ฉ”์ธ ํŽ˜์ด์ง€ CSP ๊ฐ•ํ™” ๋ฐ ๊ฒ€์ฆ ํ…Œ์ŠคํŠธ ์ถ”๊ฐ€#97
seonghobae wants to merge 1 commit into
mainfrom
sentinel-strict-csp-main-10918979539190325931

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

๐Ÿšจ Severity: HIGH
๐Ÿ’ก Vulnerability: ๋ฉ”์ธ index.html์ด ๋А์Šจํ•œ default-src 'self' CSP์™€ base-uri 'self'๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์–ด, ์—„๊ฒฉํ•œ ๊ฑฐ๋ถ€ ๊ธฐ๋ณธ(deny-by-default) ์ ‘๊ทผ ๋ฐฉ์‹๋ณด๋‹ค ์ทจ์•ฝํ–ˆ์Šต๋‹ˆ๋‹ค. ์™ธ๋ถ€ ์Šคํฌ๋ฆฝํŠธ๋‚˜ ๋™์  ์ฝ˜ํ…์ธ ๊ฐ€ ์ถ”ํ›„ ์ถ”๊ฐ€๋  ๊ฒฝ์šฐ ๊ณต๊ฒฉ ํ‘œ๋ฉด์ด ๋„“์€ ์ƒํƒœ์˜€์Šต๋‹ˆ๋‹ค.
๐ŸŽฏ Impact: ํ–ฅํ›„ ์•ˆ์ „ํ•˜์ง€ ์•Š์€ DOM ์‹ฑํฌ๊ฐ€ ๋„์ž…๋˜๊ฑฐ๋‚˜ ์„œ๋“œํŒŒํ‹ฐ ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ํ›ผ์†๋  ๊ฒฝ์šฐ, XSS๋‚˜ ๋ฐ์ดํ„ฐ ์ฃผ์ž… ๊ณต๊ฒฉ์— ๋…ธ์ถœ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๐Ÿ”ง Fix: index.html์˜ CSP๋ฅผ default-src 'none'์œผ๋กœ ๋ณ€๊ฒฝํ•˜๊ณ , ํ•„์š”ํ•œ ์ž์‚ฐ๋งŒ ๋ช…์‹œ์ ์œผ๋กœ ํ—ˆ์šฉ(script-src 'self', style-src 'self' ๋“ฑ)ํ•˜๋„๋ก ๊ฐ•ํ™”ํ–ˆ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ base-uri์™€ object-src๋ฅผ 'none'์œผ๋กœ ์„ค์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
โœ… Verification: ์ด ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ์œ ์ง€ํ•˜๊ณ  ๊ฒ€์ฆํ•˜๊ธฐ ์œ„ํ•ด tests/test_index_security.py ํšŒ๊ท€ ํ…Œ์ŠคํŠธ๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค. ํ…Œ์ŠคํŠธ ์Šค์œ„ํŠธ๊ฐ€ ๋ชจ๋‘ ์ •์ƒ ํ†ต๊ณผํ•ฉ๋‹ˆ๋‹ค.


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

๋ฉ”์ธ ํŽ˜์ด์ง€(`index.html`)์˜ Content-Security-Policy๋ฅผ `default-src 'none'` ๊ธฐ๋ฐ˜์˜ ์—„๊ฒฉํ•œ ํ™”์ดํŠธ๋ฆฌ์ŠคํŠธ ๋ฐฉ์‹์œผ๋กœ ๊ฐ•ํ™”ํ•˜์—ฌ ์ž ์žฌ์ ์ธ ๊ณต๊ฒฉ ํ‘œ๋ฉด์„ ์ตœ์†Œํ™”ํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ ๊ฒ€์ฆํ•˜๋Š” `test_index_security.py` ํšŒ๊ท€ ํ…Œ์ŠคํŠธ๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.
@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.

Copilot AI review requested due to automatic review settings July 21, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the static siteโ€™s main entrypoint (index.html) by switching to a strict deny-by-default Content Security Policy (CSP) and adding Python regression tests to prevent future CSP loosening or inline active-content regressions.

Changes:

  • Strengthen index.html CSP to default-src 'none' with explicit allowlists for required asset types and stronger restrictions (base-uri 'none', frame-src 'none', Trusted Types enforcement).
  • Add tests/test_index_security.py to assert the strict CSP is present and that no inline <style>, inline <script>, style=, or on*= handlers exist.
  • Document the security change in CHANGELOG.md and record the security learning in .jules/sentinel.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
index.html Replaces permissive CSP with a strict allowlist CSP suitable for a static GitHub Pages site.
tests/test_index_security.py Adds regression tests that enforce strict CSP presence and absence of inline active content.
CHANGELOG.md Notes the CSP hardening under [Unreleased] for user-facing security changes.
.jules/sentinel.md Captures the CSP hardening lesson to prevent future regressions.

๐Ÿ’ก Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants