Source code Security & compliance

eval / dynamic exec on user input

Part of the AI-generated code risks check · fix arrives as a pull request

What it is

eval, new Function, vm.runInNewContext, or a shell exec is called with a string that includes request input.

Why it matters

This is arbitrary code execution with your process's privileges. There is no partial version of this vulnerability — whoever controls the input controls the server.

How to fix it

Remove the dynamic execution. Parse structured input with JSON.parse, dispatch through a lookup table of known handlers, and use execFile with an argument array rather than a shell string.

Run them all on your app

Connect your repo and your live services with read-only scopes. The first scan is free, and nothing changes without your approval.