Skip to content

πŸ›‘οΈ Sentinel: [HIGH] μ •μ±… 우회 μ„œλͺ…을 μœ„ν•œ μ•”ν˜Έν™” 검증 μΆ”κ°€#36

Closed
seonghobae wants to merge 4 commits into
mainfrom
fix-security-policy-override-9334741202511535821
Closed

πŸ›‘οΈ Sentinel: [HIGH] μ •μ±… 우회 μ„œλͺ…을 μœ„ν•œ μ•”ν˜Έν™” 검증 μΆ”κ°€#36
seonghobae wants to merge 4 commits into
mainfrom
fix-security-policy-override-9334741202511535821

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

🚨 심각도: λ†’μŒ
πŸ’‘ 취약점: μ •μ±… 우회 κΈ°λŠ₯이 μž„μ˜μ˜ ν•˜λ“œμ½”λ”©λœ λ¬Έμžμ—΄ 토큰(approvalToken)에 μ˜μ‘΄ν•˜μ—¬ μ‹œμŠ€ν…œμ˜ μ•”ν˜Έν™” μ„œλͺ… 검증 λ³΄μ•ˆ ν‘œμ€€μ„ μœ„λ°˜ν–ˆμŠ΅λ‹ˆλ‹€.
🎯 영ν–₯: μ€‘μš”ν•œ λ³΄μ•ˆ μ •μ±…(예: μ°¨λ‹¨λœ 파일 ν™•μž₯자 μ—…λ‘œλ“œ ν—ˆμš©)이 λ¬΄λ‹¨μœΌλ‘œ μ‰½κ²Œ 우회될 수 μžˆμŠ΅λ‹ˆλ‹€.
πŸ”§ μˆ˜μ • 사항:

  • μ„œλͺ… 검증을 μœ„ν•΄ HMAC-SHA256 μ•Œκ³ λ¦¬μ¦˜μ„ λ„μž…ν–ˆμŠ΅λ‹ˆλ‹€. approvalToken은 이제 approverId + ":" + extension ν˜•μ‹μ˜ νŽ˜μ΄λ‘œλ“œμ— λŒ€ν•œ HMAC μ„œλͺ… 값이어야 ν•©λ‹ˆλ‹€.
  • 이 μ„œλͺ…은 conversion.policy-override-secret을 기반으둜 생성 및 κ²€μ¦λ©λ‹ˆλ‹€.
  • μƒμˆ˜ μ‹œκ°„ μ„œλͺ… 비ꡐλ₯Ό μœ„ν•΄ MessageDigest.isEqual을 μ‚¬μš©ν•˜μ—¬ 타이밍 곡격을 λ°©μ§€ν–ˆμŠ΅λ‹ˆλ‹€.
    βœ… 검증: mvn testλ₯Ό μ‹€ν–‰ν•˜μ—¬ μƒˆλ‘œμš΄ HMAC μ„œλͺ… μœ νš¨μ„± 검사가 μ„±κ³΅ν•˜κ³  100% ν…ŒμŠ€νŠΈ 컀버리지가 μœ μ§€λ˜λŠ”μ§€ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€. μœ νš¨ν•˜μ§€ μ•Šμ€ μ„œλͺ…κ³Ό μ„€μ •λ˜μ§€ μ•Šμ€ μ‹œν¬λ¦Ώμ— λŒ€ν•œ μ‹€νŒ¨ 사둀도 μΆ”κ°€λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

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

- μ •μ±… 우회 μ‹œ ν•˜λ“œμ½”λ”©λœ 토큰 λŒ€μ‹  `conversion.policy-override-secret`을 μ‚¬μš©ν•œ HMAC-SHA256 μ•”ν˜Έν™” μ„œλͺ… 검증을 λ„μž…ν–ˆμŠ΅λ‹ˆλ‹€.
- 타이밍 곡격 λ°©μ§€λ₯Ό μœ„ν•΄ `MessageDigest.isEqual`을 μ‚¬μš©ν•œ μƒμˆ˜ μ‹œκ°„ 비ꡐλ₯Ό κ΅¬ν˜„ν–ˆμŠ΅λ‹ˆλ‹€.
- λ³€κ²½λœ 인증 λ©”μ»€λ‹ˆμ¦˜μ„ λ°˜μ˜ν•˜λ„λ‘ λ‹¨μœ„ ν…ŒμŠ€νŠΈ 및 속성을 μ—…λ°μ΄νŠΈν–ˆμŠ΅λ‹ˆλ‹€.
Copilot AI review requested due to automatic review settings June 26, 2026 21:55
@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

This PR hardens the β€œpolicy override” path (used to bypass blocked upload extensions) by replacing a hardcoded token check with cryptographic verification, making policy bypass contingent on a valid HMAC-SHA256 signature derived from a configured secret.

Changes:

  • Added conversion.policy-override-secret configuration and plumbed it through ConversionProperties into DefaultDocumentValidationService.
  • Implemented HMAC-SHA256 signature verification for policy overrides and updated failure modes/messages.
  • Updated/expanded tests to use signed tokens and cover invalid signature / missing-secret scenarios.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/java/com/clearfolio/viewer/service/DefaultDocumentValidationService.java Adds HMAC-based verification for policy override requests.
src/main/java/com/clearfolio/viewer/config/ConversionProperties.java Introduces a new policyOverrideSecret configuration property.
src/main/resources/application.yml Wires conversion.policy-override-secret from an environment variable.
src/test/java/com/clearfolio/viewer/service/DefaultDocumentValidationServiceTest.java Updates tests for signed tokens; adds negative cases for invalid signature and missing secret.
src/test/java/com/clearfolio/viewer/service/ServiceInterfaceDefaultMethodsTest.java Updates override token value in default-method delegation tests.
src/test/java/com/clearfolio/viewer/service/PolicyOverrideRequestTest.java Updates expected approval token values in request construction tests.
src/test/java/com/clearfolio/viewer/service/DefaultDocumentConversionServiceTest.java Updates expected forwarded approval token values.
src/test/java/com/clearfolio/viewer/controller/ConversionControllerTest.java Updates expected forwarded approval token values.
src/test/java/com/clearfolio/viewer/controller/ConversionControllerMultipartLimitTest.java Configures conversion.policy-override-secret for integration tests and updates signed tokens.
.jules/sentinel.md Documents the vulnerability, learning, and prevention for Sentinel tracking.

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

Comment thread src/main/java/com/clearfolio/viewer/service/DefaultDocumentValidationService.java Outdated
- μ •μ±… 우회 μ‹œ ν•˜λ“œμ½”λ”©λœ 토큰 λŒ€μ‹  `conversion.policy-override-secret`을 μ‚¬μš©ν•œ HMAC-SHA256 μ•”ν˜Έν™” μ„œλͺ… 검증을 λ„μž…ν–ˆμŠ΅λ‹ˆλ‹€.
- 타이밍 곡격 λ°©μ§€λ₯Ό μœ„ν•΄ `MessageDigest.isEqual`을 μ‚¬μš©ν•œ μƒμˆ˜ μ‹œκ°„ 비ꡐλ₯Ό κ΅¬ν˜„ν–ˆμŠ΅λ‹ˆλ‹€.
- λ³€κ²½λœ 인증 λ©”μ»€λ‹ˆμ¦˜μ„ λ°˜μ˜ν•˜λ„λ‘ λ‹¨μœ„ ν…ŒμŠ€νŠΈ 및 속성을 μ—…λ°μ΄νŠΈν–ˆμŠ΅λ‹ˆλ‹€.
@opencode-agent

Copy link
Copy Markdown

OpenCode Review Overview

  • Head SHA: 785766e09eba60602fc57ce0ea521c129b1ad297
  • Workflow run: 28268373390
  • Workflow attempt: 1
  • Gate result: APPROVE (exit 0)

Change Flow DAG

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

seonghobae and others added 2 commits June 29, 2026 01:23
- μ •μ±… 우회 μ‹œ 곡유 μ‹œν¬λ¦Ώ 기반의 ν•˜λ“œμ½”λ”©λœ 토큰 λŒ€μ‹  `conversion.policy-override-public-key`λ₯Ό μ‚¬μš©ν•œ λΉ„λŒ€μΉ­ν‚€(RSA-SHA256) μ•”ν˜Έν™” μ„œλͺ… 검증을 λ„μž…ν–ˆμŠ΅λ‹ˆλ‹€.
- `approverId + ":" + extension` ν˜•μ‹μ˜ νŽ˜μ΄λ‘œλ“œλ₯Ό μ„œλͺ…ν•˜μ—¬ 토큰 μœ„μ‘°λ₯Ό λ°©μ§€ν–ˆμŠ΅λ‹ˆλ‹€.
- μ„œλͺ… 검증 둜직이 μ˜¬λ°”λ₯΄κ²Œ λ™μž‘ν•˜λ„λ‘ ν…ŒμŠ€νŠΈ 슈트 λ‚΄μ˜ 토큰듀을 λ™μ μœΌλ‘œ μƒμ„±λœ μœ νš¨ν•œ RSA μ„œλͺ…κ°’μœΌλ‘œ κ°±μ‹ ν–ˆμŠ΅λ‹ˆλ‹€.
@seonghobae

Copy link
Copy Markdown
Collaborator Author

쀑볡 정리(2μ°¨): 'μ •μ±… μ„œλͺ… μ•”ν˜Έκ²€μ¦' ν΄λŸ¬μŠ€ν„° 쀑볡 β†’ μ •λ³Έ #83 μœ μ§€. 동일 λͺ©μ /파일둜 λ™μ‹œ 병합 λΆˆκ°€. 고유 변경은 #83에 λ°˜μ˜ν•˜κ±°λ‚˜ μž¬μ˜€ν”ˆ.

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

Copy link
Copy Markdown

쀑볡 정리(2μ°¨): 'μ •μ±… μ„œλͺ… μ•”ν˜Έκ²€μ¦' ν΄λŸ¬μŠ€ν„° 쀑볡 β†’ μ •λ³Έ #83 μœ μ§€. 동일 λͺ©μ /파일둜 λ™μ‹œ 병합 λΆˆκ°€. 고유 변경은 #83에 λ°˜μ˜ν•˜κ±°λ‚˜ μž¬μ˜€ν”ˆ.

ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€. 이 μž‘μ—…μ€ 더 이상 ν•„μš”ν•˜μ§€ μ•Šμ€ κ²ƒμœΌλ‘œ κ°„μ£Όν•˜κ³  μ€‘λ‹¨ν•˜κ² μŠ΅λ‹ˆλ‹€.

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