CVE-2026-33940: Insecure Ast Node Return

Returning a pre-parsed AST node (e.g., 'Program') directly without structural validation can lead to arbitrary code execution if the input is attacker-controlled. A crafted object can bypass compilation guards and inject arbitrary code. Ensure that dynamically provided ASTs are validated against type confusion and unexpected literals before processing.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0JS
greprules fetch cve-2026-33940-insecure-ast-node-return --engine opengrep

Description

Returning a pre-parsed AST node (e.g., 'Program') directly without structural validation can lead to arbitrary code execution if the input is attacker-controlled. A crafted object can bypass compilation guards and inject arbitrary code. Ensure that dynamically provided ASTs are validated against type confusion and unexpected literals before processing.