Korjaa DeepSec-turvatarkistusten kattavuus - #89
Conversation
|
Warning Review limit reached
Next review available in: 9 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe change broadens Android and Health Connect security matcher detection, adds scoped parsing for URI shares and balanced Android log calls, introduces matcher tests and execution configuration, and refines processing-lock recovery plus CLI argument validation. ChangesSecurity matcher updates
Processing-lock recovery
Estimated code review effort: 4 (Complex) | ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee2e6c6386
ℹ️ 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".
| const enclosingBlockEnd = findEnclosingBlockEnd(content, start); | ||
| const end = Math.min(nextShareStart, enclosingBlockEnd); |
There was a problem hiding this comment.
Keep scanning after nested intent construction blocks
When an ACTION_SEND intent is created inside an if, when, or run block and EXTRA_STREAM is added after that block, findEnclosingBlockEnd stops the scope at the inner closing brace. The scope therefore contains no EXTRA_STREAM, so the matcher emits nothing even if the subsequently configured share omits both URI grants and ClipData; use the owning function/statement scope or syntax-aware intent tracking instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.deepsec/scripts/recover-processing-locks.test.mjs (1)
147-155: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover option-like values too.
This only exercises an absent next token; add a case such as
--data-dir --dry-runto cover thevalue.startsWith("--")rejection branch.Proposed test addition
assert.notEqual(result.status, 0); assert.match(result.stderr, new RegExp(`Missing value for ${option}`)); + + const optionLikeValue = spawnSync( + process.execPath, + [scriptPath, option, "--dry-run"], + { encoding: "utf8" }, + ); + assert.notEqual(optionLikeValue.status, 0); + assert.match(optionLikeValue.stderr, new RegExp(`Missing value for ${option}`));🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.deepsec/scripts/recover-processing-locks.test.mjs around lines 147 - 155, Add a test covering an option-like token supplied as the value for a required option, such as invoking recover-processing-locks.mjs with --data-dir --dry-run. Assert the command fails and reports the missing value, exercising the value.startsWith("--") rejection branch alongside the existing absent-value cases.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.deepsec/matchers/android-uri-share-without-clipdata.ts:
- Around line 46-67: Update findEnclosingBlockEnd to resolve the block belonging
to the share builder opened after the Intent action, rather than defaulting to
the enclosing function’s end; preserve correct nesting and use the containing
expression end when appropriate. Add a regression covering an unsafe share
followed by an unrelated share with ClipData and a read grant, ensuring the
unrelated share cannot suppress the unsafe match.
In @.deepsec/matchers/security-matchers.test.ts:
- Around line 38-43: Update the regression test around writeNoiseDose(report) so
the subsequent statement contains a sensitive token such as “export” or “uri”,
making accidental consumption across the call boundary observable; keep the
assertion verifying that only the intended matches are returned.
In @.deepsec/matchers/sensitive-android-log.ts:
- Around line 34-54: Update the call-scanning loop around the quote/depth
tracking to recognize and skip both Kotlin line comments (`//` through the
newline) and block comments (`/*` through `*/`) before processing parentheses,
while preserving quote and escape handling. Add a regression case covering a `)`
inside each comment form and verify the sensitive Log call is still detected.
---
Nitpick comments:
In @.deepsec/scripts/recover-processing-locks.test.mjs:
- Around line 147-155: Add a test covering an option-like token supplied as the
value for a required option, such as invoking recover-processing-locks.mjs with
--data-dir --dry-run. Assert the command fails and reports the missing value,
exercising the value.startsWith("--") rejection branch alongside the existing
absent-value cases.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 3279ab7d-0177-424a-81dd-aea1c4ab8a29
⛔ Files ignored due to path filters (1)
.deepsec/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (12)
.deepsec/.gitignore.deepsec/matchers/android-exported-component.ts.deepsec/matchers/android-uri-share-without-clipdata.ts.deepsec/matchers/fileprovider-broad-path.ts.deepsec/matchers/foreground-audio-service-start.ts.deepsec/matchers/health-connect-sensitive-flow.ts.deepsec/matchers/security-matchers.test.ts.deepsec/matchers/sensitive-android-log.ts.deepsec/package.json.deepsec/pnpm-workspace.yaml.deepsec/scripts/recover-processing-locks.mjs.deepsec/scripts/recover-processing-locks.test.mjs
|



Summary by CodeRabbit
Bug Fixes
Tests