psf-binary-parser-check(8)
Overview
binary-parser code injection, January and November 2026: read-only checker (v1) CVE-2026-134814, CVE-2026-1245
binary-parser (npm) compiles each parser definition into JavaScript with the
Function constructor. Values from the definition were pasted into that code
without validation, so whoever controls a parser definition can run
JavaScript in the Node.js process when the parser is compiled:
CVE-2026-1245 field names and encodings, every release before 2.3.0
CVE-2026-134814 the length, lengthInBytes, key, tag and offset options
and the namely() alias, every release before 2.3.1
Parsing untrusted binary data with a trusted, hard-coded definition is not
affected. Applications that build definitions from a schema, a JSON file, a
database or a request are. The fix is binary-parser 2.3.1; there is no
configuration switch that closes it on an older copy.Command reference
The original help text below includes the command syntax, options, environment variables and exit codes supplied with this tool. Review the source and test any change before applying it to a production system.
Original command-line help
binary-parser code injection, January and November 2026: read-only checker (v1)
CVE-2026-134814, CVE-2026-1245
If this software is helpful, consider a donation to our 501c3 nonprofit:
https://privacysafe.foundation
Help and documentation: https://privacysafe.app/docs/security-patches/developer/binary-parser/
binary-parser (npm) compiles each parser definition into JavaScript with the
Function constructor. Values from the definition were pasted into that code
without validation, so whoever controls a parser definition can run
JavaScript in the Node.js process when the parser is compiled:
CVE-2026-1245 field names and encodings, every release before 2.3.0
CVE-2026-134814 the length, lengthInBytes, key, tag and offset options
and the namely() alias, every release before 2.3.1
Parsing untrusted binary data with a trusted, hard-coded definition is not
affected. Applications that build definitions from a schema, a JSON file, a
database or a request are. The fix is binary-parser 2.3.1; there is no
configuration switch that closes it on an older copy.
Usage:
./binary-parser-check.sh [command] [arguments]
check (default) find binary-parser in package.json files, lockfiles,
installed copies (nested node_modules and Debian or
Ubuntu node-binary-parser too) and bundles that carry
its parser compiler. Each copy is judged by its version
and by the checks its code carries, so a copy patched
in place reads as fixed. Exit 0 = none affected found, 1 = an affected
copy, or a version that can't be confirmed as 2.3.1 or
newer, 2 = bad arguments.
audit DIR... list the source files under each DIR that use
binary-parser and the lines that pass a non-literal value
as a name, an encoding, one of the options above or a
namely() alias. Those are where an untrusted definition
could get in. Exit 0 = none, 1 = lines to review,
2 = bad argument.
version print the script version.
Env overrides:
ROOTS="/home /root /srv /var/www /opt /usr/local /usr/lib/node_modules
/usr/share/nodejs /usr/lib/nodejs"
where check looks (default shown; the last two hold
Debian and Ubuntu node-* packages). A directory
that does not exist is skipped.
MAX_DEPTH=9 how deep check descends under each root
BUNDLES=1 also look for bundled copies (0 skips that step,
the slowest one)
Containers: with no argument and ROOTS unset, the check also looks in running docker and podman
containers (SCAN_CONTAINERS=1, the default; 0 skips them). A read-only probe copies the
package.json and lockfiles that mention binary-parser, and each installed copy's package.json,
into a private temporary directory, and this script runs once per container in isolation against
that copy. Bundled copies are not searched inside containers. Paths shown as .../docker_NAME/...
are inside the container NAME.The Security Patches software and this documentation are dedicated to the public domain under CC0 1.0 Universal. Other pages on privacysafe.app/docs are CC BY-SA 4.0 unless the page says otherwise.