Skip to content

πŸ›‘οΈ Sentinel: [HIGH] 파일 μ—…λ‘œλ“œ μ‹œ 널 λ°”μ΄νŠΈ μ‚½μž… 취약점 μˆ˜μ •#68

Closed
seonghobae wants to merge 1 commit into
mainfrom
sentinel/null-byte-validation-6086060004679117683
Closed

πŸ›‘οΈ Sentinel: [HIGH] 파일 μ—…λ‘œλ“œ μ‹œ 널 λ°”μ΄νŠΈ μ‚½μž… 취약점 μˆ˜μ •#68
seonghobae wants to merge 1 commit into
mainfrom
sentinel/null-byte-validation-6086060004679117683

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

🚨 Severity: HIGH
πŸ’‘ Vulnerability: 파일 μ—…λ‘œλ“œ 검증 λ‘œμ§μ—μ„œ 파일 μ΄λ¦„μ˜ 널 λ°”μ΄νŠΈ(\u0000) μ‚½μž… 곡격에 λŒ€ν•œ λ°©μ–΄κ°€ λˆ„λ½λ˜μ–΄ μžˆμ–΄, ν™•μž₯자 검증 등을 μš°νšŒν•  수 μžˆλŠ” 취약점이 μ‘΄μž¬ν–ˆμŠ΅λ‹ˆλ‹€.
🎯 Impact: κ³΅κ²©μžκ°€ μ•…μ˜μ μœΌλ‘œ μ‘°μž‘λœ 파일(예: contract\u0000.pdf)을 μ—…λ‘œλ“œν•˜μ—¬ ν™•μž₯자 필터링을 μš°νšŒν•˜κ³  μ„œλ²„μ—μ„œ μ˜ˆμƒμΉ˜ λͺ»ν•œ μ½”λ“œκ°€ μ‹€ν–‰λ˜κ²Œ ν•˜κ±°λ‚˜ ν—ˆμš©λ˜μ§€ μ•Šμ€ 파일 νƒ€μž…μ„ μ—…λ‘œλ“œν•  수 μžˆμŠ΅λ‹ˆλ‹€.
πŸ”§ Fix: DefaultDocumentValidationService.java λ‚΄μ˜ validateOrThrow λ©”μ„œλ“œ μ΄ˆκΈ°μ— 파일 이름에 널 λ°”μ΄νŠΈκ°€ ν¬ν•¨λœ 경우 μ¦‰κ°μ μœΌλ‘œ IllegalArgumentException을 λ°œμƒμ‹œμΌœ μž…λ ₯을 κ±°λΆ€ν•˜λ„λ‘ λ‘œμ§μ„ μˆ˜μ •ν–ˆμŠ΅λ‹ˆλ‹€.
βœ… Verification: DefaultDocumentValidationServiceTest에 rejectsFilenameWithNullByte ν…ŒμŠ€νŠΈ μΌ€μ΄μŠ€λ₯Ό μΆ”κ°€ν•˜μ—¬ ν•΄λ‹Ή 둜직이 정상 μž‘λ™ν•¨μ„ κ²€μ¦ν–ˆμŠ΅λ‹ˆλ‹€ (mvn test).


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

파일 μ—…λ‘œλ“œ μ‹œ 원본 파일λͺ…에 널 λ°”μ΄νŠΈ(`\u0000`)κ°€ ν¬ν•¨λœ 경우 이λ₯Ό λͺ…μ‹œμ μœΌλ‘œ μ°¨λ‹¨ν•˜λŠ” λ‘œμ§μ„ `DefaultDocumentValidationService`에 μΆ”κ°€ν–ˆμŠ΅λ‹ˆλ‹€. 이λ₯Ό 톡해 ν™•μž₯자 μœ νš¨μ„± 검사 우회 λ“±μ˜ 파일λͺ… κ΄€λ ¨ 취약점을 λ°©μ–΄ν•©λ‹ˆλ‹€. κ΄€λ ¨ λ‹¨μœ„ ν…ŒμŠ€νŠΈλ„ ν•¨κ»˜ μΆ”κ°€ν•˜μ—¬ 컀버리지 100%λ₯Ό λ‹¬μ„±ν–ˆμŠ΅λ‹ˆλ‹€.
Copilot AI review requested due to automatic review settings July 1, 2026 21:03
@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 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

Hardens the document upload validation layer against null byte (\u0000) injection in filenames, preventing extension-validation bypass during multipart upload handling.

Changes:

  • Rejects uploads whose originalFilename contains a null byte by throwing IllegalArgumentException early in validateOrThrow.
  • Adds a unit test ensuring filenames like contract\u0000.pdf are rejected with the expected error message.
  • Updates the Jules Sentinel note to document the null byte injection prevention learning.

Reviewed changes

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

File Description
src/main/java/com/clearfolio/viewer/service/DefaultDocumentValidationService.java Adds early filename null-byte validation and rejects invalid input before extension parsing.
src/test/java/com/clearfolio/viewer/service/DefaultDocumentValidationServiceTest.java Adds a regression test covering null byte injection in filenames.
.jules/sentinel.md Documents the null byte injection prevention guidance.

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

@github-actions github-actions Bot 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

OpenCode exhausted the configured model pool without a usable current-head review conclusion. This is not approval evidence, so the PR is blocked until a source-backed review can establish approval sufficiency or identify concrete fixes.

Findings

1. HIGH .jules/sentinel.md:1 - OpenCode could not establish approval sufficiency

  • Problem: every configured model path failed to produce a usable current-head control block.
  • Root cause: model execution, timeout, export, normalization, or approval-gate validation did not complete after exponential retry across the configured model pool.
  • Impact: approving from deterministic check state alone would miss PR-intent mismatches, missing files, edge-case bugs, robustness gaps, UX/DX regressions, security issues, and CodeGraph-backed base/head flow changes.
  • Fix: rerun OpenCode after model availability recovers, or update the PR with the missing files, tests, docs, generated artifacts, and verification evidence needed for a source-backed review conclusion.
  • Regression test: keep the approval gate posting REQUEST_CHANGES, not APPROVE or check-only failure, when no model produces a valid current-head review.

Summary

  • Result: REQUEST_CHANGES
  • Reason: coverage-evidence passed and peer GitHub Checks completed without failures, but no model produced a valid review control block.
  • Deterministic evidence checked but not used for approval: current-head changed-file evidence (.jules/sentinel.md, src/main/java/com/clearfolio/viewer/service/DefaultDocumentValidationService.java, src/test/java/com/clearfolio/viewer/service/DefaultDocumentValidationServiceTest.java); coverage-evidence result success; peer checks from statusCheckRollup excluding this OpenCode check.
  • Model outcome: model_pool=exhausted; selected_model=none.
  • Head SHA: 86232024bac52e3cffaa4acd04747f1cadf654e0
  • Workflow run: 28547653612
  • Workflow attempt: 1

No PR approval was posted because model-output failure is not evidence that the PR has no blockers.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
Loading

Comment thread .jules/sentinel.md
**Vulnerability:** Untrusted paths from API responses were directly assigned to `a.href` and used in `iframe` generation, which allows execution of malicious URIs like `javascript:` or `data:`.
**Learning:** Even when avoiding `innerHTML`, directly setting URL-like strings to DOM attributes without protocol validation introduces XSS vectors. The payload can be executed when the link is clicked or the iframe is loaded.
**Prevention:** Implement an `isSafeUrl` verification function to ensure the protocol is strictly `http:` or `https:` (using `new URL()`) before assigning untrusted inputs to DOM attributes like `href` or `src`.
## 2026-07-01 - [Null Byte Injection Prevention]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

HIGH OpenCode could not establish approval sufficiency

  • Problem: the model pool exhausted without a valid current-head review control block, so this changed line cannot be approved from deterministic check state alone.
  • Impact: PR-intent mismatches, missing files, robustness bugs, UX/DX regressions, and CodeGraph-backed flow changes could be missed.
  • Fix: rerun OpenCode after model availability recovers, or add the missing source/test/docs/generated verification evidence needed for a source-backed approval.
  • Verification: rerun the OpenCode Review workflow and confirm it emits APPROVE or source-backed REQUEST_CHANGES for this head SHA.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

OpenCode Review Overview

  • Head SHA: 86232024bac52e3cffaa4acd04747f1cadf654e0
  • Workflow run: 28547653612
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode exhausted the configured model pool without a usable current-head review conclusion. This is not approval evidence, so the PR is blocked until a source-backed review can establish approval sufficiency or identify concrete fixes.

Findings

1. HIGH .jules/sentinel.md:1 - OpenCode could not establish approval sufficiency

  • Problem: every configured model path failed to produce a usable current-head control block.
  • Root cause: model execution, timeout, export, normalization, or approval-gate validation did not complete after exponential retry across the configured model pool.
  • Impact: approving from deterministic check state alone would miss PR-intent mismatches, missing files, edge-case bugs, robustness gaps, UX/DX regressions, security issues, and CodeGraph-backed base/head flow changes.
  • Fix: rerun OpenCode after model availability recovers, or update the PR with the missing files, tests, docs, generated artifacts, and verification evidence needed for a source-backed review conclusion.
  • Regression test: keep the approval gate posting REQUEST_CHANGES, not APPROVE or check-only failure, when no model produces a valid current-head review.

Summary

  • Result: REQUEST_CHANGES
  • Reason: coverage-evidence passed and peer GitHub Checks completed without failures, but no model produced a valid review control block.
  • Deterministic evidence checked but not used for approval: current-head changed-file evidence (.jules/sentinel.md, src/main/java/com/clearfolio/viewer/service/DefaultDocumentValidationService.java, src/test/java/com/clearfolio/viewer/service/DefaultDocumentValidationServiceTest.java); coverage-evidence result success; peer checks from statusCheckRollup excluding this OpenCode check.
  • Model outcome: model_pool=exhausted; selected_model=none.
  • Head SHA: 86232024bac52e3cffaa4acd04747f1cadf654e0
  • Workflow run: 28547653612
  • Workflow attempt: 1

No PR approval was posted because model-output failure is not evidence that the PR has no blockers.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
Loading

@seonghobae

Copy link
Copy Markdown
Collaborator Author

쀑볡 정리: 이 PR은 '파일 ν™•μž₯자/null-byte 검증' ν΄λŸ¬μŠ€ν„°μ˜ μ€‘λ³΅μž…λ‹ˆλ‹€. μ •λ³ΈμœΌλ‘œ #76 (APPROVED + CI green + MERGEABLE)을 μœ μ§€ν•©λ‹ˆλ‹€. 동일 νŒŒμΌμ„ μˆ˜μ •ν•΄ λ™μ‹œ 병합이 λΆˆκ°€λŠ₯ν•˜λ―€λ‘œ μ •λ¦¬ν•©λ‹ˆλ‹€. κ³ μœ ν•˜κ²Œ ν•„μš”ν•œ 변경이 있으면 #76에 λ°˜μ˜ν•˜κ±°λ‚˜ μž¬μ˜€ν”ˆν•˜μ„Έμš”.

@seonghobae seonghobae closed this Jul 7, 2026
@google-labs-jules

Copy link
Copy Markdown

쀑볡 정리: 이 PR은 '파일 ν™•μž₯자/null-byte 검증' ν΄λŸ¬μŠ€ν„°μ˜ μ€‘λ³΅μž…λ‹ˆλ‹€. μ •λ³ΈμœΌλ‘œ #76 (APPROVED + CI green + MERGEABLE)을 μœ μ§€ν•©λ‹ˆλ‹€. 동일 νŒŒμΌμ„ μˆ˜μ •ν•΄ λ™μ‹œ 병합이 λΆˆκ°€λŠ₯ν•˜λ―€λ‘œ μ •λ¦¬ν•©λ‹ˆλ‹€. κ³ μœ ν•˜κ²Œ ν•„μš”ν•œ 변경이 있으면 #76에 λ°˜μ˜ν•˜κ±°λ‚˜ μž¬μ˜€ν”ˆν•˜μ„Έμš”.

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