Join our Newsletter — 33% off our NHI Course
Home› FAQ› Cyber Security› How should security teams organise JavaScript static analysis…
Cyber Security

How should security teams organise JavaScript static analysis across browser code, Node.js services, and Express applications?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated November 4, 2026 Domain: Cyber Security

Security teams should use separate rulesets when codebases have different risk profiles and runtime assumptions. A browser focused ruleset, a Node.js ruleset, and an Express ruleset reduce noise and make coverage easier to understand. The goal is to match rules to the execution context, then run them in CI or locally so developers can fix issues before release.

How to split JavaScript static analysis by runtime

The right organising principle is execution context, not one universal ruleset. Browser code has different trust boundaries, globals, DOM access and dependency exposure than Node.js services, while Express adds web-facing request handling and middleware-specific risks. A single shared baseline can still exist, but the browser, Node.js and Express layers should be tuned separately so findings reflect what each runtime can actually do.

That separation matters because the same pattern can be safe in one runtime and dangerous in another. For example, browser code should be judged for DOM sinks, client-side data leakage and unsafe use of web APIs, while Node.js needs more attention on file system access, child processes, package risk and runtime permissions. Express then adds request parsing, cookies, routing and middleware order as first-class review points.

A practical structure is to keep a common baseline for truly shared issues, then branch into runtime-specific rule packs. That lets teams preserve consistency without forcing every rule to fit every codebase. It also makes it easier to explain why a rule fires, which reduces the common problem of developers ignoring alerts that feel irrelevant to their stack. For browser work, teams often pair that baseline with a browser-focused reference such as Browser Security Buyer's Guide when the goal is to understand browser-specific control choices and evaluation criteria.

For Node.js, static analysis should explicitly reflect the runtime’s server-side behavior and supply chain exposure. That means rules for unsafe install scripts, prototype pollution, risky dynamic execution and overbroad permissions should live in the Node profile, not in a generic web profile. Teams that want a deeper control reference for this runtime can anchor those rules to the Node.js Security Guide and the more restrictive Node.js Permission Model Guide, which are both aligned to server-side exposure and least-privilege runtime behaviour.

Express should be treated as a separate web application surface, not just another Node package. Static analysis there benefits from rules that understand middleware ordering, request body limits, trust proxy usage, cookie settings, rate limiting and other HTTP handling choices. The most useful outcome is not more alerts, but fewer false positives and more actionable ones. Teams can use the Express.js Security Guide to keep those checks focused on the framework-specific failure modes that matter in production.

Why different rule packs reduce noise and improve coverage

Browser, Node.js and Express code share JavaScript syntax, but they do not share the same security model. Static analysis should therefore map rules to the objects each runtime actually handles: browser code handles user interaction and DOM state, Node.js handles server-side execution and local system access, and Express handles HTTP request processing and middleware sequencing. If teams collapse all three into one ruleset, they either miss important runtime-specific problems or flood developers with warnings that do not apply.

The cleanest way to think about this is coverage by risk profile. A browser profile should emphasise client-side injection, unsafe DOM manipulation, browser storage exposure and web platform misuse. A Node.js profile should emphasise dependency risk, server-side execution paths, dangerous APIs and permission boundaries. An Express profile should emphasise request validation, session handling, routing assumptions and middleware misuse. A secure coding reference like Secure Coding Guide is useful as the baseline layer because it ties those runtime-specific checks back to broader coding discipline without flattening the differences between them.

That split also helps teams decide what belongs in shared policy versus what belongs in a project-specific profile. A shared policy can enforce minimum expectations such as banned patterns, secret detection and dangerous sink detection, while each runtime profile adds the rules that are only meaningful in its context. For teams building a broader programme around scanning, triage and developer feedback, the Semgrep Guide is a useful fit because it covers custom rules, CI rollout and practical rule management.

Static analysis is most effective when the rule set matches the codebase ownership model. Browser teams should own browser-specific rules, platform or backend teams should own Node.js rules, and API or web application teams should own Express rules. That prevents a common failure mode where one central security team curates a generic profile that nobody feels responsible for tuning.

How to operationalise the split in CI and developer workflows

The operational goal is to make the right rules visible at the right moment. Run the browser profile against browser packages, the Node.js profile against server packages, and the Express profile against the web application package or route layer. Keep the execution local or in CI so developers see runtime-specific feedback before merge, then use branch policy or required checks only where the signal is stable enough to trust.

Teams should also decide how they will handle shared utilities and monorepo code. If a package can run in more than one runtime, the safer approach is to test it against the strictest applicable profile, then add a runtime tag or path-based routing rule so the scanner knows which checks to apply. Where the code truly spans runtimes, a single file may need more than one ruleset, but the reporting should still make clear which finding belongs to which execution context.

When this model is working well, developers can tell at a glance why a finding exists and what runtime assumption triggered it. That is the practical test: the rule should point to a real security decision, not just a pattern match. For teams building their broader application security process, the Application Security Guide is helpful as a programme-level reference for integrating static analysis with triage, review gates and developer ownership.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP ASVS, CIS Controls v8 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV13 — ConfigurationBrowser, Node.js and Express profiles depend on secure configuration by runtime.
V15 — Secure Coding and ArchitectureStatic analysis here is about runtime-aware secure coding decisions and code structure.
Recommendation — Align rules to runtime-specific configuration checks and keep separate profiles for browser, Node.js and Express. Use runtime-specific code review rules to catch insecure patterns before release.
CIS Controls v8CIS-16 — Application Software SecurityStatic analysis across JavaScript runtimes is a core application security practice.
Recommendation — Embed SAST into CI and maintain separate rule sets for different application runtimes.
NIST SP 800-53 Rev 5SA-11 — Developer Testing and EvaluationStatic analysis is a developer testing activity that should be tailored to the target runtime.
CM-7 — Least FunctionalityNode.js and Express analysis should flag overbroad capabilities and unnecessary runtime access.
Recommendation — Apply runtime-specific static analysis as part of developer testing and evaluation. Restrict each runtime profile to the minimum functions and permissions it needs.

Practitioner Guidance

What to prioritise: Start by classifying repositories by runtime before you write or import rules. If a package can execute in the browser, on Node.js and behind Express, do not let one scanner profile try to represent all three equally.

What to verify: Check whether each rule has a clear runtime assumption behind it, such as DOM access, file-system access or HTTP request handling. If you cannot state the assumption, the rule is probably too generic to be useful.

Common mistake: Teams often optimise for consistency and end up with a single noisy ruleset. Better practice is a shared baseline plus a small number of targeted profiles that developers can understand and maintain.

Practitioner takeaway: The best static analysis programme is not the broadest one, it is the one that respects runtime context closely enough that developers trust the findings and security teams can tune coverage without diluting signal.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 4, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org