Skip to content

🛡️ Sentinel: [MEDIUM] Fix strix logging for path traversal - #1194

Draft
seonghobae wants to merge 9 commits into
developfrom
fix-security-path-logging-214336017500004903
Draft

🛡️ Sentinel: [MEDIUM] Fix strix logging for path traversal#1194
seonghobae wants to merge 9 commits into
developfrom
fix-security-path-logging-214336017500004903

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Draft preservation / consolidation lane

This PR is not a second Resource Admission writer. Canonical validate_analysis_job_request ownership remains Draft #866, current exact 7a10f3cc8359ef44bfd52fbf31d7df287912d103, on protected develop@314ddeae7b775a4957594b599358c8255617eb2e.

Successor evidence

#866 has ordinarily adopted the only distinct runtime/test behavior from this branch without merging or rebasing #1194:

  • RED 0e313169299eb6112343ca7d8fbac612d6df5942 injects a parent-traversal segment plus a forged newline suffix and requires rejection while the malicious path remains absent from logger arguments.
  • Production 5546a17ccc848e2d043359586a2abc0bd198a66c adds the bounded fixed warning Security: path traversal detected in localSource.sourcePath before the existing rejection.
  • Exact repair descendant 7c0e858da327daa07b56c75b2a90a2761b4c4880 restores unrelated text-only drift from the file replacement. Comparing pre-RED 4cb93a74... with that descendant leaves one production-line addition plus the dedicated regression.
  • Doctoring af3efa803141cd139efd3d61fb1a9503fbbf316f records CWE-117 rationale, rejected raw-path/repr() alternatives, and the claim boundary; later fix(audio): establish canonical local-audio resource policy #866 descendants retain it.

The earlier branch-to-branch consolidation probe #1195 was non-mergeable and introduced no unique delta, so it was closed unmerged rather than using force-push or destructive rebase.

Authority / close rule

The original generated description was wrong to suggest logging attacker-controlled path content. The product diagnostic intentionally records only the fixed field identifier. .jules/sentinel.md is learning metadata, not a second product authority; its useful rationale is represented in canonical doctoring.

Current #866 has advanced into persisted feature-cache resource-admission work. That later work neither changes nor weakens the succeeded source-path diagnostic semantics above. Keep this PR Draft/open until the exact #866 successor has qualifying current-head verification. Do not merge independently. Close as fully succeeded only after exact successor evidence demonstrates the runtime/test/doctoring semantics above are preserved; queued, blocked, predecessor, or self-authored review evidence does not satisfy that rule.

@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.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T04:18:58.900864Z 7971fb9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7971fb989e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +303 to +304
path = repr(source_path)
logger.warning("Security: path traversal detected in localSource.sourcePath: %s", path)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Redact rejected paths instead of logging them verbatim

When an untrusted sourcePath, cacheRoot, or tempRoot contains a parent segment, this warning now records the entire path. repr() prevents newline forging but does not redact or truncate usernames, directory names, or an arbitrarily long payload, contrary to docs/security/app-security.md, which explicitly prohibits logging full original file paths. Log only the rejected field/reason or a bounded, redacted identifier instead. The repository makes its app-security rules mandatory for logging changes.

AGENTS.md reference: AGENTS.md:L7-L7

Useful? React with 👍 / 👎.

Comment on lines +285 to +286
path = repr(project_id)
logger.warning("Security: path traversal detected in projectId: %s", path)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route traversal warnings to an observable sink

In the normal desktop analysis flow these warnings never create an audit trail: cli.py configures Python logging to stderr, while apps/desktop/src-tauri/src/main.rs:415-420 drains that stderr into a byte buffer and line 486 discards the joined result. Consequently the new warnings are visible only during direct CLI use or tests, not when a traversal attempt arrives through the shipped desktop orchestration path. Forward a redacted warning to the app's logging sink or otherwise consume the captured buffer. The repository makes its app-security rules mandatory for logging changes.

AGENTS.md reference: AGENTS.md:L7-L7

Useful? React with 👍 / 👎.

Comment thread services/analysis-engine/tests/test_api.py Fixed
@seonghobae
seonghobae marked this pull request as draft September 9, 2026 05:16

Copy link
Copy Markdown
Collaborator Author

Fresh single-writer review: keep this PR Draft. Its unique security delta (escaped traversal-attempt logging) touches services/analysis-engine/src/bandscope_analysis/api.py, which is already under the canonical #866 Resource Admission & Decode source lane, and it also carries an unrelated Ruff-only edit to services/analysis-engine/tests/test_supply_chain_policy.py, whose inherited protected-base repair is owned by #1176. Do not close or discard the logging regression: preserve the unique safe-logging test/evidence and ordinary-adopt it into the canonical owner after checking the current #866 head. Remove/leave the supply-chain formatter delta with #1176 rather than duplicating it here. Also re-review privacy before logging full local source paths: repr() contains control characters, but incident usefulness does not by itself justify recording purpose-unbounded path/PII. Current live source head observed during this handoff is 2fc24efa13f9e508ce574d3e2dab3a6260200424; no merge/Ready claim.

@google-labs-jules

Copy link
Copy Markdown

Fresh single-writer review: keep this PR Draft. Its unique security delta (escaped traversal-attempt logging) touches services/analysis-engine/src/bandscope_analysis/api.py, which is already under the canonical #866 Resource Admission & Decode source lane, and it also carries an unrelated Ruff-only edit to services/analysis-engine/tests/test_supply_chain_policy.py, whose inherited protected-base repair is owned by #1176. Do not close or discard the logging regression: preserve the unique safe-logging test/evidence and ordinary-adopt it into the canonical owner after checking the current #866 head. Remove/leave the supply-chain formatter delta with #1176 rather than duplicating it here. Also re-review privacy before logging full local source paths: repr() contains control characters, but incident usefulness does not by itself justify recording purpose-unbounded path/PII. Current live source head observed during this handoff is 2fc24efa13f9e508ce574d3e2dab3a6260200424; no merge/Ready claim.

Understood. Acknowledging the instruction to keep this PR as a draft and that the unique security delta should be ordinarily adopted into #866. I have also noted the privacy concern regarding logging full local paths and the overlap with #1176 for the formatter delta. I am stopping work on this PR as instructed.

Copy link
Copy Markdown
Collaborator Author

Single-writer/privacy finding after fresh overlap review: keep this Draft and do not merge api.py ahead of canonical Resource Admission #866 (c400e652079b59e70816114538072278edddaea9). The unique regression target is worth preserving, but repr(project_id) still emits attacker-controlled/user-supplied content into durable logs; escaping newlines prevents record forging but does not satisfy purpose-bound data minimization or prevent secrets/path fragments from being logged. Please preserve the test intent while revising the acceptance contract to log the rejected field/category (or another explicitly justified bounded non-reversible correlation token), not the payload value itself. Also keep localSource.sourcePath on the same privacy rule. Once #866 reaches protected ancestry, ordinary-adopt the unique safe-logging regression without copying stale #1194 api.py source or #1176 formatter deltas.

Comment thread services/analysis-engine/tests/test_api.py Fixed

Copy link
Copy Markdown
Collaborator Author

Fresh single-writer review: keep this PR Draft and do not merge it independently. validate_analysis_job_request and its local-audio path/resource admission tests are already inside canonical Resource Admission & Decode owner #866, now exact 7ade8c0f917c1c562b7d0a6f94c35d52404ca43d on the same protected develop@314ddeae... base. #1194 changes exactly .jules/sentinel.md, api.py, and test_api.py; merging it separately would create a competing writer in the same admission function.

Preserve the genuinely distinct evidence rather than closing it: the only material behavior not already present in #866 is adding the bounded field-name warning for localSource.sourcePath and its regression. The projectId/cacheRoot/tempRoot edits mostly re-express already-bounded field-name logging to satisfy a scanner pattern, and the PR body must not claim that attacker payloads are logged because the implementation deliberately logs only hardcoded field identifiers to avoid CWE-117/PII leakage.

Handoff rule: adopt/adapt the unique sourcePath diagnostic regression into #866 by ordinary descendant work if it survives review, keep .jules/sentinel.md out of the product semantic delta unless its own owner requires it, and close #1194 only after exact evidence shows every valid delta/test is present in the canonical successor. No force-push, destructive rebase, or parallel admission merge.

}
try:
validate_analysis_job_request(malicious_payload)
except ValueError:

Copy link
Copy Markdown
Collaborator Author

Canonical #866 has now ordinarily adopted/adapted the unique runtime/test semantics from this preservation lane without merging this branch. RED 0e313169299eb6112343ca7d8fbac612d6df5942 adds a traversal + forged-newline regression; production 5546a17ccc848e2d043359586a2abc0bd198a66c adds only the bounded localSource.sourcePath warning; exact repair descendant 7c0e858da327daa07b56c75b2a90a2761b4c4880 restores two unrelated text-only drifts from the full-file write. 4cb93a74...→7c0e858d... is exactly one production-line addition plus the dedicated regression. Doctoring af3efa803141cd139efd3d61fb1a9503fbbf316f carries the useful CWE-117/privacy rationale, so .jules/sentinel.md is not needed as a second product authority.

Keep this PR Draft/open until the exact successor has qualifying current-head verification. Do not merge it independently. The failed branch-to-branch consolidation probe #1195 carried no unique delta and was closed.

@google-labs-jules

Copy link
Copy Markdown

Single-writer/privacy finding after fresh overlap review: keep this Draft and do not merge api.py ahead of canonical Resource Admission #866 (c400e652079b59e70816114538072278edddaea9). The unique regression target is worth preserving, but repr(project_id) still emits attacker-controlled/user-supplied content into durable logs; escaping newlines prevents record forging but does not satisfy purpose-bound data minimization or prevent secrets/path fragments from being logged. Please preserve the test intent while revising the acceptance contract to log the rejected field/category (or another explicitly justified bounded non-reversible correlation token), not the payload value itself. Also keep localSource.sourcePath on the same privacy rule. Once #866 reaches protected ancestry, ordinary-adopt the unique safe-logging regression without copying stale #1194 api.py source or #1176 formatter deltas.

Acknowledged. I understand the privacy concern and the need to log only bounded field-names.

@google-labs-jules

Copy link
Copy Markdown

Fresh single-writer review: keep this PR Draft and do not merge it independently. validate_analysis_job_request and its local-audio path/resource admission tests are already inside canonical Resource Admission & Decode owner #866, now exact 7ade8c0f917c1c562b7d0a6f94c35d52404ca43d on the same protected develop@314ddeae... base. #1194 changes exactly .jules/sentinel.md, api.py, and test_api.py; merging it separately would create a competing writer in the same admission function.

Preserve the genuinely distinct evidence rather than closing it: the only material behavior not already present in #866 is adding the bounded field-name warning for localSource.sourcePath and its regression. The projectId/cacheRoot/tempRoot edits mostly re-express already-bounded field-name logging to satisfy a scanner pattern, and the PR body must not claim that attacker payloads are logged because the implementation deliberately logs only hardcoded field identifiers to avoid CWE-117/PII leakage.

Handoff rule: adopt/adapt the unique sourcePath diagnostic regression into #866 by ordinary descendant work if it survives review, keep .jules/sentinel.md out of the product semantic delta unless its own owner requires it, and close #1194 only after exact evidence shows every valid delta/test is present in the canonical successor. No force-push, destructive rebase, or parallel admission merge.

Understood. Acknowledging the instruction to keep this PR as a draft and that the unique security delta should be ordinarily adopted into #866. I am stopping work on this branch as instructed.

@google-labs-jules

Copy link
Copy Markdown

Canonical #866 has now ordinarily adopted/adapted the unique runtime/test semantics from this preservation lane without merging this branch. RED 0e313169299eb6112343ca7d8fbac612d6df5942 adds a traversal + forged-newline regression; production 5546a17ccc848e2d043359586a2abc0bd198a66c adds only the bounded localSource.sourcePath warning; exact repair descendant 7c0e858da327daa07b56c75b2a90a2761b4c4880 restores two unrelated text-only drifts from the full-file write. 4cb93a74...→7c0e858d... is exactly one production-line addition plus the dedicated regression. Doctoring af3efa803141cd139efd3d61fb1a9503fbbf316f carries the useful CWE-117/privacy rationale, so .jules/sentinel.md is not needed as a second product authority.

Keep this PR Draft/open until the exact successor has qualifying current-head verification. Do not merge it independently. The failed branch-to-branch consolidation probe #1195 carried no unique delta and was closed.

Understood. Acknowledging that the relevant changes have been adopted into canonical PR #866. I will leave this PR as a draft as instructed and stop 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.

1 participant