Ara’s analysis engine runs a set of compiled regex patterns against every source file in a package. Each pattern has a unique ID, a severity level, and a description of what it catches. Understanding these patterns helps you make informed decisions when Ara flags a dependency — and helps you write package code that doesn’t trigger false positives.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ara-home/ara/llms.txt
Use this file to discover all available pages before exploring further.
How the scanner works
Before any regex matching begins, the scanner collects the files it will analyze. It walks the package directory recursively and includes files that match these extensions:package.json specifically to check for install scripts — but it uses string matching for that, not regex.
Several categories of files are skipped outright:
- Binary files — any file containing a null byte (
\0) is treated as binary and skipped. - Large files — files larger than 1 MB are skipped to keep scans fast.
- Declaration files —
.d.ts,.d.mts, and.d.ctsfiles are type-only and skipped. - Ignored directories —
node_modules/,.git/,.svn/,.hg/,dist/,target/,build/,.next/,.cache/, and__pycache__/are all excluded.
All patterns
The table below lists all 18 patterns (17 code patterns + 1package.json check), sorted by severity.
| Pattern ID | Severity | What it detects |
|---|---|---|
eval-usage | Critical | eval() calls — arbitrary code execution |
new-function | Critical | new Function() — dynamic code creation |
child-process-exec | High | spawn, fork, execFile, execSync, spawnSync — shell command execution |
child-process-require | High | require('child_process') — import of the child process module |
vm-escape | High | vm.runInThisContext, vm.runInNewContext, vm.compileFunction, vm.createScript |
process-binding | High | process.binding() — access to native Node.js internals |
prototype-pollution | High | __proto__ assignment or use as a key |
constructor-pollution | High | .constructor.prototype manipulation |
install-scripts | High | preinstall, install, or postinstall keys in package.json |
fs-dangerous-write | Medium | fs.writeFile, fs.writeFileSync, fs.appendFile, fs.appendFileSync |
fs-dangerous-delete | Medium | fs.unlink, fs.unlinkSync, fs.rm, fs.rmSync, fs.rmdir, fs.rmdirSync |
credential-access | Medium | process.env access for NODE_*, AWS_*, GITHUB_*, TOKEN, SECRET, PASSWORD, PASS, API_KEY, API_SECRET, ACCESS_KEY, SECRET_KEY, PRIVATE_KEY |
alloc-unsafe | Medium | Buffer.allocUnsafe(), Buffer.allocUnsafeSlow() — uninitialized memory allocation |
dynamic-require | Medium | require() with a non-literal argument |
dynamic-import | Medium | import() with a non-literal argument |
weak-crypto | Medium | createHash('md5'), createHash('sha1'), createHash('ripemd160') |
math-random | Low | Math.random() — not cryptographically secure |
deprecated-cipher | Low | createCipher(), createDecipher(), createDecipheriv() — deprecated Node.js cipher methods |
Pattern details by severity
Critical — Immediate code execution
Critical — Immediate code execution
These patterns represent the highest risk. Any package triggering a A real-world example from the test fixtures showing combined
critical finding is capable of executing arbitrary code at runtime and should be denied unless you have fully audited the usage.eval-usage — matches any call to eval():new-function — matches new Function(...) constructor calls, which compile and execute arbitrary strings as JavaScript:eval-usage + dynamic string construction:High — Significant attack surface
High — Significant attack surface
high findings indicate real abuse potential that is highly context-dependent. A utility library that spawns child processes for legitimate build tooling is very different from a data-formatting library doing the same thing.child-process-exec — matches common child process invocation methods. Note that cp.exec() is intentionally not matched (too many false positives from regex engines); execSync and spawnSync are matched:child-process-require — matches the module import itself, regardless of what method is called afterward:vm-escape — matches the four vm module methods most commonly used to escape sandboxes:process-binding — matches calls to process.binding(), which grants access to internal C++ bindings and is a known sandbox escape vector:prototype-pollution — matches __proto__ when followed by an assignment or used as a key:constructor-pollution — matches .constructor.prototype chaining:install-scripts — detected by string matching inside package.json, not by regex over source code. Any package that defines preinstall, install, or postinstall in its scripts block triggers this finding:Medium — Suspicious but context-dependent
Medium — Suspicious but context-dependent
medium findings are often legitimate in the right context but are common in supply-chain attack code. Evaluate the surrounding logic before approving.fs-dangerous-write — matches synchronous and asynchronous file write operations:fs-dangerous-delete — matches file and directory removal operations:credential-access — matches process.env access for sensitive-sounding variable names. The pattern looks for common prefixes and keywords:alloc-unsafe — Buffer.allocUnsafe skips zero-initialization, leaving old memory contents readable. If used to allocate a buffer that is later sent over the network or written to a file, it can leak sensitive data:dynamic-require and dynamic-import — match require() and import() calls where the argument is not a string literal. Static strings are safe (the module is known at audit time); dynamic values can load arbitrary code:weak-crypto — matches createHash calls using broken hash algorithms. MD5 and SHA-1 have known collision attacks; RIPEMD-160 is no longer recommended:Low — Informational
Low — Informational
low findings are rarely indicative of malicious intent on their own, but they are worth noting in security-sensitive code.math-random — Math.random() uses a non-cryptographic PRNG. Using it to generate tokens, session IDs, or nonces is a security bug:deprecated-cipher — matches the deprecated createCipher, createDecipher, and createDecipheriv Node.js APIs. These were removed in Node.js 22 because they derive keys without a salt, making them vulnerable to dictionary attacks:Interpreting findings in context
A finding is a signal, not a verdict. The samechild-process-exec call in a test runner framework and in a data-validation library mean very different things. When reviewing findings, ask:
- Is this call site reachable from user-controlled input? An
eval()deep in a template engine is far more dangerous than one used to parse a hardcoded configuration string. - Does the package’s stated purpose require this capability? A build tool importing
child_processis expected; a currency formatter is not. - Is the pattern in the package’s own code or in a vendored dependency? Ara skips
node_modules/sub-directories inside packages, so findings only reflect the package’s own files.