Skip to content

chore(scanner): Review Scan blocking rules - #191

Open
mguerrero3-godaddy wants to merge 1 commit into
mainfrom
fix/review-blocking-rules
Open

chore(scanner): Review Scan blocking rules#191
mguerrero3-godaddy wants to merge 1 commit into
mainfrom
fix/review-blocking-rules

Conversation

@mguerrero3-godaddy

Copy link
Copy Markdown
Collaborator

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.

@mguerrero3-godaddy mguerrero3-godaddy self-assigned this Aug 7, 2026
Copilot AI lite review requested due to automatic review settings August 7, 2026 16:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.md to 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 thread rust/src/extension/mod.rs
Comment on lines +358 to 359
severity: Severity::Warn,
description: "Bundled code contains a debugger statement which enables remote debugging access",
Comment thread rust/src/extension/mod.rs
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:?}"
);
}
Comment thread rust/src/extension/mod.rs
@@ -332,21 +341,21 @@ static RULE_DEFS: &[RuleDef] = &[
r#"https?://(?!(?:(?:[a-zA-Z0-9-]+\.)*godaddy\.com|localhost|127\.0\.0\.1)(?:[:/?#\s]|$))[^\s"'\x60<>]+"#,
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