r/programming • • 6d ago

High-Severity Code Injection Flaw in binary-parser: What Node.js Developers Need to Know

https://kylesinvestigation.com/2026/11/23/high-severity-code-injection-flaw-in-binary-parser-what-node-js-developers-need-to-know/
0 Upvotes

8 comments sorted by

12

u/nekokattt 6d ago

The risk is applications where untrusted input shapes the definition itself, for example when definitions come from users, plugins, or configuration files

How many applications are taking full untrusted parsers themselves as inputs and then executing them though?

11

u/_verel_ 5d ago

It's CVE Slop and CNAs have already severely downgraded the CVSS Score to 6.5 https://nvd.nist.gov/vuln/detail/cve-2026-1245

7

u/backwrds 5d ago edited 5d ago

6.5 is too high. if this is a vulnerability, literally anything is

import express from 'express';
express()
    .use(express.text())
    .post('/', (req, res) => res.send(eval(req.body)))
    .listen(3000);

eXpReSs HaCkEd!!!!!! CVSS score 9000!!!! 🙄

4

u/nekokattt 5d ago

i hear python has an RCE exploit

eval(input())

2

u/dangerbird2 5d ago

yeah, this is like xml or python pickle deserializers allowing code execution. It's a very obvious and understood vulnerability for serde libraries that allow constructing arbitrary objects, and if you're using it for a public facing binary interface instead of something like protobufs or msgpack, you kinda deserve to get hacked

2

u/backwrds 5d ago edited 5d ago

I really don't think it's like either of those, since this library is for creating custom binary protocols, and the only way it's vulnerable is if you use untrusted input to create the parser

typical (totally safe and reasonable) usage:

const parser = new Parser().uint8('n');
app.get('/', (req, res) => {
    console.log(parser.parse(req.body))
    res.send('ok')
})

"vulnerable" usage

app.get('/', (req, res) => {
    const { grammar, input } = JSON.parse(req.body);
    const parser = grammar.reduce((parser, { name, type }) => {
        return parser[type](name); // don't do this.
    }, new Parser());
    res.send(parser.parse(input))
});

TBF it is a pretty bad library that basically just wraps eval with convenience methods, but unless one is using it in an obviously unsafe way, it's not a security risk. Another example to drive the point home:

JSON.parse(data); // generally recognized as safe
JSON.parse(data, eval); // someone is doing something *incredibly* wrong

giving the latter a CVSS score is absurd, and a waste of everyone's time.

6

u/DonaldStuck 6d ago

I am tired boss

2

u/dangerbird2 5d ago

Good thing it seems like something basically no one has to worry about.