chore(scanner): Review Scan blocking rules - #191
Open
mguerrero3-godaddy wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Rust extension bundle security scanner rule documentation and tests to reflect a reclassification of certain findings, aligning the Rust-port-only rules (SEC111–SEC115) with intended false-positive/DEVEX behavior.
Changes:
- Downgrades SEC113 (encoding/decoding) and SEC114 (
debugger) from Block to Warn and updates associated tests. - Adds/clarifies commentary around which rules were ported from the TS baseline vs introduced in the Rust port.
- Expands documentation in
AGENTS.mdto reflect the Rust-port-only rules and their current severities.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| rust/src/extension/mod.rs | Adjusts scanner rule severities for SEC113/SEC114, updates/extends unit tests, and adds clarifying comments about Rust-port-only rules. |
| AGENTS.md | Documents the TS-baseline vs Rust-only rule split and current block/warn severities for SEC111–SEC115. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+358
to
359
| severity: Severity::Warn, | ||
| description: "Bundled code contains a debugger statement which enables remote debugging access", |
Comment on lines
+2805
to
+2817
| #[test] | ||
| fn sec115_template_literal_require_not_matched() { | ||
| // SEC115's regex treats any leading backtick as a "literal" argument, | ||
| // so this does not fire today | ||
| let findings = scan_bundle( | ||
| r#"const plugin = require(`./plugins/${pluginName}`);"#, | ||
| "test.mjs", | ||
| ); | ||
| assert!( | ||
| findings.iter().all(|f| f.rule_id != "SEC115"), | ||
| "findings: {findings:?}" | ||
| ); | ||
| } |
| @@ -332,21 +341,21 @@ static RULE_DEFS: &[RuleDef] = &[ | |||
| r#"https?://(?!(?:(?:[a-zA-Z0-9-]+\.)*godaddy\.com|localhost|127\.0\.0\.1)(?:[:/?#\s]|$))[^\s"'\x60<>]+"#, | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Decision summary
SEC111 -> still blocks, unchanged
What it catches: Deleting files (unlink/rm/rmdir), only if fs is imported
Why: Already gated to require an actual fs import first. Destructive file deletion from a hosted extension is legitimately dangerous.
SEC112 -> still blocks, unchanged
What it catches: Any URL that isn't *.godaddy.com
Why: Sending data to an arbitrary external server is exactly the risk this was intended to block, not just warn about.
SEC113 -> now warns instead of block
What it catches: atob() / base64/hex decoding
Why: Fires on totally normal code (e.g. decoding a data URI or JWT) with zero context check. SEC109 already treats the equivalent large-blob pattern as Warn, SEC113 was blocking on the same signal.
SEC114 -> now warns instead of block
What it catches: A debugger; statement left in the code
Why: Development leftover, not a security exploit, it doesn't really give an attacker any new capability.
SEC115 -> still blocks, unchanged
What it catches: Dynamic require()/import() with a computed (non-literal) path
Why: A dynamically-resolved module path is a way to smuggle in code the scanner can't see.