Summary
Angular Expressions, a standalone expression parser for AngularJS, contained a sandbox escape that allowed crafted expressions using filters to execute arbitrary code on the underlying system.
When untrusted input is evaluated by Angular Expressions prior to version 1.5.2, an attacker may break out of the intended sandbox and gain full code execution in the application environment.
Affected context
This vulnerability appears in applications that:
- Use Angular Expressions as a standalone module or as part of server-side or privileged evaluation flows
- Dynamically evaluate user-controlled or otherwise untrusted strings as Angular expressions
- Rely on Angular Expressions' sandboxing features to prevent access to dangerous objects and APIs
The risk is highest where expression evaluation happens in privileged contexts (e.g., server-side rendering, templating, or contexts with access to OS or process APIs).
Exploit preconditions
- Attack surface: Any feature where user-provided data is interpreted as an Angular expression and passed into Angular Expressions for evaluation.
- Required access: Ability to supply or influence expression content (e.g., form fields, template configuration, query parameters, stored content).
- Trigger point: Evaluation of a malicious expression that leverages filters and other expression features to bypass the sandbox.
- Why exploitation is possible: The expression sandbox incorrectly restricted access to underlying JavaScript/host objects, allowing crafted expressions to traverse to powerful APIs and execute arbitrary code.
Why this happens
The core issue is a sandbox bypass in the Angular Expressions engine, mapping to CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code.
The sandbox was intended to constrain what expressions could access, but the filter mechanism and related expression features left paths to escape these constraints.
As a result, attacker-controlled expression strings could reach privileged objects or functions, effectively turning dynamic expression evaluation into a code execution primitive.
Potential impact
- Execution of arbitrary code within the application's execution environment
- Access to sensitive runtime data, including secrets and configuration
- Server-side compromise when expressions are evaluated on the backend
- Lateral movement within the hosting environment or container
- Data exfiltration, data tampering, or complete application takeover
General mitigation guidance
Effective mitigation generally focuses on avoiding dynamic evaluation of untrusted expressions and hardening sandbox boundaries:
- Treat all expression strings as untrusted by default and avoid evaluating user-controlled content whenever possible.
- Restrict where and how Angular Expressions is used; prefer static templates or whitelisted expression fragments instead of free-form user expressions.
- Introduce an explicit allowlist for permitted filters and expression constructs, rejecting anything outside a narrowly defined subset.
- Apply strong separation of privileges so that expression evaluation runs in a minimally privileged context with no direct access to sensitive APIs or OS capabilities.
- Centralize expression evaluation logic and enforce consistent input validation and sanitization rather than scattering evaluation calls throughout the codebase.
How teams detect issues like this
Detection typically combines review of code paths that perform dynamic evaluation with tooling-assisted analysis:
- Use static analysis to find all usages of Angular Expressions and any APIs that evaluate strings as expressions, especially where arguments are derived from HTTP requests, database fields, or other user input.
- During code review, flag patterns where business logic constructs expressions from concatenated or interpolated user data, or where filters are applied dynamically.
- Implement secure coding standards that prohibit or tightly control dynamic expression evaluation and require explicit justification for any exceptions.
- Consider automated scanning in CI to search for known unsafe evaluation patterns and to enforce policies around expression evaluation and sandboxing.

