Skip to content

πŸ›‘οΈ Sentinel: [λ³΄μ•ˆ κ°œμ„ ] base-uri CSP κ°•ν™” (base-uri 'none') - #99

Closed
seonghobae wants to merge 1 commit into
mainfrom
sentinel-strict-base-uri-2539522658319416106
Closed

πŸ›‘οΈ Sentinel: [λ³΄μ•ˆ κ°œμ„ ] base-uri CSP κ°•ν™” (base-uri 'none')#99
seonghobae wants to merge 1 commit into
mainfrom
sentinel-strict-base-uri-2539522658319416106

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

🚨 Severity: MEDIUM
πŸ’‘ Vulnerability: index.html의 CSP μ„€μ •μ—μ„œ base-uriκ°€ 'self'둜 μ„€μ •λ˜μ–΄ μžˆμ–΄ λΆˆν•„μš”ν•˜κ²Œ 넓은 κΆŒν•œμ΄ λΆ€μ—¬λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 이 앱은 <base> νƒœκ·Έλ₯Ό μ‚¬μš©ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
🎯 Impact: <base> νƒœκ·Έ μ‚½μž… 취약점을 ν†΅ν•œ 경둜 및 URL ν•˜μ΄μž¬ν‚Ή μœ„ν—˜μ΄ μ‘΄μž¬ν–ˆμŠ΅λ‹ˆλ‹€.
πŸ”§ Fix: CSP의 base-uri μ§€μ‹œμ–΄λ₯Ό 'none'으둜 λ³€κ²½ν•˜κ³ , κ΄€λ ¨ 검증 ν…ŒμŠ€νŠΈλ₯Ό μΆ”κ°€ν–ˆμŠ΅λ‹ˆλ‹€.
βœ… Verification:

python3 -m pytest tests/

λͺ…령을 톡해 λͺ¨λ“  ν…ŒμŠ€νŠΈκ°€ ν†΅κ³Όν•˜λŠ”μ§€ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.


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

`index.html`의 Content Security Policyμ—μ„œ `base-uri` 속성을 `'self'`μ—μ„œ `'none'`으둜 λ³€κ²½ν•˜μ˜€μŠ΅λ‹ˆλ‹€.
이λ₯Ό 톡해 base νƒœκ·Έ μ‚½μž… 곡격을 μ›μ²œμ μœΌλ‘œ μ°¨λ‹¨ν•©λ‹ˆλ‹€.
ν•΄λ‹Ή 변경을 κ²€μ¦ν•˜κΈ° μœ„ν•œ νšŒκ·€ ν…ŒμŠ€νŠΈ(`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 23, 2026 14:05

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

Tightens the static site’s CSP in index.html by locking down base-uri to prevent <base>-tag injection–based URL/path hijacking, and adds a regression test to ensure the policy stays strict over time.

Changes:

  • Update index.html CSP from base-uri 'self' to base-uri 'none'.
  • Add a pytest regression test asserting the main page declares a strict base-uri.
  • Document the security learning/prevention note in .jules/sentinel.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
index.html Tightens CSP by setting base-uri 'none' for stronger default hardening.
tests/test_index_security.py Adds a regression test to detect CSP regressions for base-uri.
.jules/sentinel.md Records the security rationale and prevention guidance for future changes.

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

Comment on lines +16 to +18
assert match is not None, "index.html must declare a CSP meta policy"
policy = match.group(1)
assert "base-uri 'none'" in policy

Copy link
Copy Markdown
Contributor Author

Closing as already implemented on main. The current page uses a stronger deny-by-default CSP with base-uri 'none', explicit same-origin resource directives, blocked forms/frames/objects, and regression tests that reject unsafe inline/eval content. This branch is superseded.

@seonghobae seonghobae closed this Aug 6, 2026
@google-labs-jules

Copy link
Copy Markdown

Closing as already implemented on main. The current page uses a stronger deny-by-default CSP with base-uri 'none', explicit same-origin resource directives, blocked forms/frames/objects, and regression tests that reject unsafe inline/eval content. This branch is superseded.

Understood. Acknowledging that this work is now obsolete and stopping work on 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.

2 participants