π‘οΈ Sentinel: [MEDIUM] Fix Exception information leakage in analysis engine#495
π‘οΈ Sentinel: [MEDIUM] Fix Exception information leakage in analysis engine#495seonghobae wants to merge 4 commits into
Conversation
π¨ Severity: MEDIUM π‘ Vulnerability: Pythonμ Exception κ°μ²΄κ° κ·Έλλ‘ λ¬Έμμ΄ν(str)λμ΄ νλ‘ νΈμλ λλ CLI μλ΅μΌλ‘ λ ΈμΆλ λ, νμΌμ μ λ κ²½λ‘λ λ΄λΆ λ‘μ§(Third-party λΌμ΄λΈλ¬λ¦¬μ μμΈ μλ¬ λ©μμ§ λ±)μ΄ κ·Έλλ‘ λ ΈμΆλ μνμ΄ μ‘΄μ¬ν©λλ€. π― Impact: 곡격μκ° λ°νλ μλ¬ λ©μμ§λ₯Ό ν΅ν΄ μμ€ν κ²½λ‘ κ΅¬μ‘°, κΆν λ° λ΄λΆ κ΅¬μ± μ 보λ₯Ό νμ νμ¬ λ λ€λ₯Έ 곡격 벑ν°λ₯Ό μ€κ³ν μ μμ΅λλ€. π§ Fix: - `bandscope_analysis/api.py` λ΄λΆμ `_stem_separation_worker`μμ λ°μνλ Exceptionμ "An internal engine error occurred." λ±κ³Ό κ°μ΄ μμ ν μΌλ°μ μΈ(generic) λ©μμ§λ‘ λ체νμ΅λλ€. - `bandscope_analysis/cli.py`μμ λ°μνλ μμΈ λν μλ³Έ λ©μμ§λ₯Ό λ ΈμΆνμ§ μλλ‘ λ³κ²½νμ΅λλ€. - μ΄ μ¬νμ `.jules/sentinel.md` μ λμ κΈ°λ‘νμ΅λλ€. β Verification: `test_api.py`, `test_cli.py` λ±μ ν΅ν ν μ€νΈ μ½λκ° μ μ λμν¨μ νμΈνμ΅λλ€.
|
π 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
This PR hardens services/analysis-engine error handling at IPC/CLI boundaries by masking raw exception strings so local paths and internal engine details arenβt surfaced via multiprocessing queue payloads or CLI JSON output.
Changes:
- Mask
_stem_separation_workerexception payloads by returning safe, generic messages per error class instead ofstr(error). - Mask stem-separation failure messaging in
run_analysis_job_updatesso queue-derived exceptions donβt leak details into status updates. - Prevent CLI
--job <path>file-read failures from echoing raw exception text into JSON output.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| services/analysis-engine/tests/test_api.py | Updates expectations to assert masked/safe error messages instead of raw exception strings. |
| services/analysis-engine/src/bandscope_analysis/cli.py | Masks job-file read errors so CLI JSON output no longer includes raw exception details. |
| services/analysis-engine/src/bandscope_analysis/api.py | Sanitizes multiprocessing queue error payloads and masks stem-separation failure messages in job updates. |
| .jules/sentinel.md | Documents the exception information-leakage pattern and the prevention approach. |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
OpenCode Review Overview
Pull request overviewOpenCode cannot approve yet because required coverage evidence did not pass. Check outcome1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
Coverage evidenceCoverage Evidence
Python project dependencies (services/analysis-engine)
Python coverage with missing-line report (services/analysis-engine)
Python docstring coverage
JavaScript/TypeScript dependencies (npm ci)
Repository docstring coverage
JavaScript/TypeScript test coverageMerge Conflict Guidance
gh pr checkout 495 --repo ContextualWisdomLab/bandscope
git fetch origin develop
git merge --no-ff origin/develop # or: git rebase origin/develop
git status --short
# resolve files, then git add <resolved-files>
# merge path: git commit
# rebase path: git rebase --continue
git push origin HEAD:sentinel-fix-exception-leak-7528836404433324664
# rebase path only: git push --force-with-lease origin HEAD:sentinel-fix-exception-leak-7528836404433324664 |
There was a problem hiding this comment.
Pull request overview
OpenCode reviewed the current-head bounded evidence and found no blocking issues.
Findings
No blocking findings.
Summary
Approval sufficiency: bounded evidence supplied affirmative approval evidence for changed files, coverage/docstring posture, risk surfaces, and current-head verification; approval is not based merely on the absence of known blockers.
Verification posture: CodeGraph evidence was initialized and bounded current-head evidence reviewed for changed-file evidence including .jules/sentinel.md, services/analysis-engine/src/bandscope_analysis/api.py, services/analysis-engine/src/bandscope_analysis/cli.py, services/analysis-engine/tests/test_api.py.
Linter/static: workflow/static review evidence is bounded by the current-head GitHub Checks gate and changed-file evidence.
TDD/regression: coverage execution evidence and focused changed hunks were reviewed from bounded-review-evidence.md.
Coverage: coverage execution evidence reports supported repository test suites passed.
Docstring coverage: coverage execution evidence reports configured repository docstring gates passed or docstring coverage was advisory.
DAG: CodeGraph/source-backed behavior map connects .jules/sentinel.md to the affected review, runtime, or workflow path and required checks.
PoC/execution: coverage-evidence job executed on the current head and reported PASS.
DDD/domain: workflow and repository-governance invariants were reviewed against changed files in bounded evidence.
CDD/context: CodeGraph evidence, changed-file history, and focused hunks were reviewed from bounded-review-evidence.md.
Similar issues: changed-file history evidence was reviewed for comparable local precedents.
Claim/concept check: bounded evidence, repository source, current-head workflow evidence, and, where numeric, scientific, statistical, or literature-backed claims are affected, original-paper/formula evidence and parameter-recovery expectations were used for claims.
Standards search: standards and external-source checks are delegated to configured OpenCode web_search/Context7/DeepWiki sources when applicable; no evidence-backed standards blocker is present in bounded evidence.
Compatibility/convention: changed workflow/script conventions, object naming, and reserved-word safety for schema/API/config/code surfaces were checked in bounded evidence.
Breaking-change/backcompat: deployment evidence and changed-file history were checked for backward-compatibility risk.
Performance: changed surfaces were checked for performance risk in bounded evidence.
Developer experience: changed automation, review, test, setup, and maintenance surfaces were checked for helpful or obstructive DX impact in bounded evidence.
User experience: connected user, operator, API, CLI, documentation, review-comment, status-check, rendering, and workflow-reader behavior was checked for contradictions against code, docs, and tests in bounded evidence.
Visual/DOM: Playwright visual, DOM locator, ARIA snapshot, console, and responsive evidence were checked when a web UI surface was present; for non-web surfaces, API/CLI/log/docs/workflow interaction evidence was reviewed instead.
Accessibility/i18n: accessibility, localization, and human-readable text surfaces were checked where UI, CLI, API message, docs, logs, or review text changed.
Supply-chain/license: dependency, package, model, container, and external-tool changes were checked in bounded evidence.
Packaging: package, build, test, lint, and security contracts were checked in bounded evidence.
Security/privacy: workflow-token, review-gate, and repository-automation security/privacy boundaries were checked in bounded evidence.
- Result: APPROVE
- Reason: Security fix implemented with proper error masking and test coverage
- Head SHA:
f1c65b11b4b8c0c158c07b271a47643b82e4f202 - Workflow run: 28489683594
- Workflow attempt: 1
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"]
Evidence --> S2["Test: test_api.py"]
S2 --> I2["regression suite"]
I2 --> R2["Review risk: Test: test_api.py"]
R2 --> V2["targeted test run"]
π¨ Severity: MEDIUM π‘ Vulnerability: Pythonμ Exception κ°μ²΄κ° κ·Έλλ‘ λ¬Έμμ΄ν(str)λμ΄ νλ‘ νΈμλ λλ CLI μλ΅μΌλ‘ λ ΈμΆλ λ, νμΌμ μ λ κ²½λ‘λ λ΄λΆ λ‘μ§(Third-party λΌμ΄λΈλ¬λ¦¬μ μμΈ μλ¬ λ©μμ§ λ±)μ΄ κ·Έλλ‘ λ ΈμΆλ μνμ΄ μ‘΄μ¬ν©λλ€. π― Impact: 곡격μκ° λ°νλ μλ¬ λ©μμ§λ₯Ό ν΅ν΄ μμ€ν κ²½λ‘ κ΅¬μ‘°, κΆν λ° λ΄λΆ κ΅¬μ± μ 보λ₯Ό νμ νμ¬ λ λ€λ₯Έ 곡격 벑ν°λ₯Ό μ€κ³ν μ μμ΅λλ€. π§ Fix: - `bandscope_analysis/api.py` λ΄λΆμ `_stem_separation_worker`μμ λ°μνλ Exceptionμ "An internal engine error occurred." λ±κ³Ό κ°μ΄ μμ ν μΌλ°μ μΈ(generic) λ©μμ§λ‘ λ체νμ΅λλ€. - `bandscope_analysis/cli.py`μμ λ°μνλ μμΈ λν μλ³Έ λ©μμ§λ₯Ό λ ΈμΆνμ§ μλλ‘ λ³κ²½νμ΅λλ€. - μ΄ μ¬νμ `.jules/sentinel.md` μ λμ κΈ°λ‘νμ΅λλ€. β Verification: `test_api.py`, `test_cli.py` λ±μ ν΅ν ν μ€νΈ μ½λκ° μ μ λμν¨μ νμΈνμ΅λλ€.
|
νμ¬ \ κΈ°μ€μΌλ‘ μ΄ PRμ μλ update-branch λμμ΄ μλλΌ merge conflict μνμ λλ€. μμ cloneμμ \λ‘ μ¬ννμ΅λλ€. μΆ©λ νμΌ:
κΆμ₯ μ²λ¦¬:
μ΄ μνμμλ OpenCode/auto-mergeκ° νλ¨μΌλ‘ ν΄κ²°ν μ μκ³ , μ¬λμ΄ μΆ©λ λ΄μ©μ μ νν΄μΌ ν©λλ€. |
|
μ μ : λ°λ‘ μ conflict μλ΄ λκΈμ shell quoting λ¬Έμ λ‘ inline code μΌλΆκ° λλ½λμ μ μμ΅λλ€. νμ¬ develop κΈ°μ€ merge simulation κ²°κ³Όλ μλκ° μ νν©λλ€. μλ update-branch λμμ΄ μλλΌ merge conflict μνμ λλ€. μμ cloneμμ git merge --no-commit --no-ff origin/develop λ‘ μ¬ννμ΅λλ€. μΆ©λ νμΌ:
κΆμ₯ μ²λ¦¬:
μ΄ μνμμλ OpenCode/auto-mergeκ° νλ¨μΌλ‘ ν΄κ²°ν μ μκ³ , μ¬λμ΄ μΆ©λ λ΄μ©μ μ νν΄μΌ ν©λλ€. |
Pull request was closed
π¨ Severity: MEDIUM
π‘ Vulnerability:
services/analysis-engineλͺ¨λ λ΄μμ μ€λ₯(μ:FileNotFoundError,ValueError, κΈ°νException) λ°μ μ, νμ΄μ¬μ raw Exception κ°μ²΄κ° λ¬Έμμ΄νλμ΄ IPC νλ CLI JSON μΆλ ₯μΌλ‘ μ§μ λ ΈμΆλκ³ μμμ΅λλ€. μ΄λ "Fail securely" μμΉμ μλ°νλ©° νμΌ μ λ κ²½λ‘λ λ΄λΆ λμμ λν λ¨μλ₯Ό λ ΈμΆμν΅λλ€.π― Impact: μ΄λ‘ μΈν΄ 곡격μκ° μ ν리μΌμ΄μ μ λ΄λΆ ꡬ쑰λ μμ€ν νμΌ κ²½λ‘λ₯Ό μ μΆν μ μμ΅λλ€.
π§ Fix:
services/analysis-engine/src/bandscope_analysis/api.pyμμ_stem_separation_workerμμΈ μ²λ¦¬κΈ°κ° μλ¬ μ’ λ₯λ³λ‘ μμ ν generic λ¬Έμμ΄("An internal engine error occurred." λ±)λ§ λ°ννλλ‘ λ§μ€νΉ λ‘μ§μ μ μ©νμ΅λλ€.services/analysis-engine/src/bandscope_analysis/cli.pyμμλ JSON νμ±/νμΌ λ‘λ© μ€ν¨ μ raw μλ¬κ° λ ΈμΆλμ§ μλλ‘ μ²λ¦¬νμ΅λλ€.β Verification: λ‘컬μμ
uv run pytest testsλ°npm run checkλͺ λ ΉμΌλ‘ ν μ€νΈλ₯Ό μ λΆ ν΅κ³Όνλ κ²(Coverage 100%)μ νμΈνμ΅λλ€.PR created automatically by Jules for task 7528836404433324664 started by @seonghobae