Menu

The Word "eval" Is Not the Problem. Understanding What It Refers To Is.
πŸ“°

The Word "eval" Is Not the Problem. Understanding What It Refers To Is.

DEV Community: securityΒ·jackymenCZ (jackymenCZ)Β·about 11 hours ago
#XGPnZQdf
#devtosecurity#devto#dev#eval#function
Reading 0:00
15s threshold

How SentinelIR learned to follow variable bindings, aliases and control flow instead of blindly matching code.

Imagine you're building a security analyzer.

Thanks for support..

Release: "Sentinel-IR-MCP v0.2.2 on GitLab" ( https://gitlab.com/jakubrojicek11/sentinel-ir-mcp/-/tree/v0.2.2?ref_type=tags )

Package: " [email protected] on npm" ( https://www.npmjs.com/package/sentinel-ir-mcp/v/0.2.2 )

You want to detect dangerous JavaScript functions, so you search the source code for the word "eval".

Simple, right?

Not quite.

The first trap: the same name can mean different things

Consider this:

function evaluate(code) {

return String(code);

}

Should this trigger a critical security warning?

No. The function is called "evaluate", not "eval".

Now look at this:

function run(eval) {

eval();

}

Should this trigger a warning?

Not necessarily. Here, "eval" is a function parameter.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.