Interlace ESLint
ESLint Interlace

Static Analysis Limitations

Understanding what static analysis can and cannot detect, and how to build robust security with these limitations in mind

Understanding Static Analysis Limitations

The Gist: Static analysis is like a security guard who checks IDs at the door—great at catching known fakes, but can't follow people around once they're inside.

Quick Summary
CatchesKnown patterns (eval, innerHTML, SQL concat), API misuse
MissesRuntime values, dynamic code, business logic, dependencies
Coverage~80% of common vulnerabilities (OWASP Top 10)
Combine WithDAST, dependency scanning, penetration testing

Why this matters: Knowing what static analysis can and cannot do helps you build a more robust security strategy that combines automated tools with proper security practices.

What is Static Analysis?

Static analysis examines your code without executing it. ESLint reads your source files, parses them into an Abstract Syntax Tree (AST), and applies rules to detect potential issues.

Where Static Analysis Excels

✅ Pattern Detection

Identifying known vulnerable patterns like eval(), innerHTML, and SQL string concatenation.

✅ API Misuse

Detecting incorrect usage of security-sensitive APIs like JWT verification or crypto functions.

✅ Configuration Issues

Finding hardcoded secrets, weak crypto algorithms, and insecure configurations.

✅ Consistent Enforcement

Applying the same security standards across your entire codebase automatically.

Where Static Analysis Cannot Help

Static analysis has fundamental limitations due to the halting problem - it's mathematically impossible to determine all behaviors of a program without running it.

❌ Runtime Values

Cannot determine what values variables will hold at runtime, especially from external sources.

❌ Dynamic Code

Code generated at runtime, eval'd strings, and dynamic imports are invisible to static analysis.

❌ Business Logic

Authorization flaws, race conditions, and business logic vulnerabilities require runtime context.

❌ External Dependencies

Vulnerabilities in third-party libraries require dependency scanning tools (npm audit, Snyk).

The Data Flow Challenge

One of the biggest limitations is tracing data flow through complex applications.

What We Can Detect

// ✅ Direct pattern - DETECTED
const query = `SELECT * FROM users WHERE id = ${req.params.id}`;

// ✅ Simple variable tracking - DETECTED
const userId = req.params.id;
const query = `SELECT * FROM users WHERE id = ${userId}`;

What We Cannot Reliably Detect

// ❌ Sanitized input - FALSE POSITIVE possible
const userId = sanitize(req.params.id);
const query = `SELECT * FROM users WHERE id = ${userId}`;

// ❌ Complex data flow - MISSED
function getQuery(options) {
  return buildDynamicQuery(options);
}
const query = getQuery({ filter: req.body.filter });

// ❌ Async data - MISSED
const data = await fetchFromDatabase(req.params.id);
processUnsafely(data);

Known False Negatives: Every Interlace rule documents its limitations in a "Known False Negatives" section. We believe in transparency about what we can and cannot detect.

How Interlace Mitigates These Limitations

Conservative Pattern Matching We flag potentially dangerous patterns

even when we can't confirm they're exploitable, erring on the side of caution.

Sanitizer Awareness Rules recognize common sanitization patterns to

reduce false positives while still catching genuine issues.

LLM-Optimized Messages Our error messages include context that helps AI

assistants understand the issue and suggest appropriate fixes.

Documented Limitations Every rule explicitly documents what it cannot

detect, so you know where additional security measures are needed.

Building a Robust Security Strategy

Static analysis should be one layer of your defense-in-depth strategy:

⚡ Key Takeaways

What To DoWhy
Enable Interlace in CICatch ~80% of common vulns automatically
Add dependency scanningnpm audit/Snyk catches supply chain attacks
Read "Known False Negatives"Know exactly what each rule misses
Layer with DASTRuntime testing finds business logic flaws

🔗 Next Steps

📚 Further Reading

On this page