Join our Newsletter — 33% off our NHI Course

Formula Engine RCE

A remote code execution condition that appears in systems allowing user-defined expressions, rules, or scoring logic. It occurs when the engine generates executable code from input that should have remained data, often exposing secrets and internal network access.

Expanded Definition

formula engine RCE describes a condition where a rule engine, expression evaluator, or scoring system turns attacker-controlled input into executable behavior instead of treating it as data. In NHI and application security contexts, this is especially dangerous because formulas often run with access to secrets, internal APIs, or trusted service identities.

Definitions vary across vendors, but the core risk is consistent: dynamic evaluation without a strict boundary between syntax and payload. A safe design treats user input as constrained expressions, not as general-purpose code. That distinction matters in systems such as workflow automation, policy scoring, fraud rules, and agentic orchestration, where the engine may have enough privilege to reach sensitive resources. NIST’s NIST Cybersecurity Framework 2.0 is useful here because its govern, protect, and detect functions map well to controlling dynamic execution paths.

The most common misapplication is assuming that a formula field is safe because it is not a traditional code editor, which occurs when developers pass untrusted text into an evaluator that supports functions, object access, or shell-like expansion.

Examples and Use Cases

Implementing formula engines safely often introduces expressiveness limits, requiring organisations to weigh business flexibility against the risk of arbitrary execution.

  • A fraud platform lets analysts define scoring rules, but an attacker injects a payload that escapes the expression sandbox and executes server-side commands.
  • A workflow system accepts user formulas for routing decisions, then resolves object references that expose secrets from configuration or runtime metadata.
  • An internal product uses a templated rules engine for notifications, and a crafted formula triggers file access or network calls through helper functions.
  • An AI agent orchestration layer evaluates policy expressions before tool execution, and a malicious prompt or rule alters the engine into calling unintended functions.

These patterns appear in real incident write-ups such as ASP.NET machine keys RCE attack and Gladinet Hard-Coded Keys RCE Exploitation, where trusted execution paths became entry points once attackers found a way to influence code-like behavior. In adjacent control design, the NIST Cybersecurity Framework 2.0 helps teams tie these evaluations to secure development and monitoring expectations.

Why It Matters in NHI Security

Formula Engine RCE is not just an application bug. In NHI environments, it can become a direct path from a low-trust input channel to high-value identities, secrets, and internal services. Once the engine runs with a service account, every exposed token, certificate, or downstream connector may be reachable as an operational asset rather than a static configuration item.

This matters because NHI compromise is already widespread. NHI Mgmt Group reports that 79% of organisations have experienced secrets leaks, with 77% resulting in tangible damage, and 97% of NHIs carry excessive privileges. A formula engine that can execute attacker-controlled logic converts that privilege into an exploitation multiplier, especially when the engine can read environment variables, call internal endpoints, or sign requests on behalf of a trusted identity. The right defensive model is to minimize execution power, isolate evaluators, and treat every formula as hostile until proven otherwise.

Organisations typically encounter the full impact only after an anomalous rule fires, at which point Formula Engine RCE becomes operationally unavoidable to address.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 and OWASP Agentic AI Top 10 address the attack and risk surface, while NIST CSF 2.0, NIST Zero Trust (SP 800-207) and NIST AI RMF set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-03 Covers insecure execution paths that let untrusted input control privileged NHI behavior.
OWASP Agentic AI Top 10 A-04 Agentic systems often use dynamic rules or tool policies that can be turned into code-like execution.
NIST CSF 2.0 PR.IP-1 Secure development practices apply to dynamic expression engines that can become execution sinks.
NIST Zero Trust (SP 800-207) SC-2 Zero Trust limits the blast radius when a formula engine is compromised through untrusted input.
NIST AI RMF MAP 2.2 AI risk management applies where scoring or rule systems can be manipulated into unsafe behavior.

Constrain evaluators so user input cannot reach privileged execution or secret-bearing contexts.