Join our Newsletter — 33% off our NHI Course
Home Glossary Cyber Security Formula Injection
Cyber Security

Formula Injection

← Back to Glossary
By NHI Mgmt Group Updated August 21, 2026 Domain: Cyber Security

A type of price manipulation where attacker-controlled input is inserted into the calculation used to compute cost. The system then evaluates the wrong formula, often because the backend fails to separate derived values from untrusted client data.

Expanded Definition

Formula injection is a pricing integrity failure in which untrusted input alters the calculation path itself, not just the values being displayed. In practice, the weakness appears when applications let client-supplied data influence a formula, discount rule, tax routine, or totals engine without server-side validation and trust separation. For NHI Management Group, the important distinction is that the attacker is not merely changing a field value, but causing the system to evaluate a different outcome. That makes formula injection a business logic issue with direct security implications.

The term is often discussed alongside input validation, insecure deserialisation, and spreadsheet-style formula abuse, but it is broader than any single user interface pattern. It can occur in payment flows, quoting engines, subscription billing, inventory valuation, and reimbursement systems. Guidance varies across vendors on whether formula injection should be treated as a pure application security defect or a fraud-adjacent control failure, but the practical response is the same: untrusted input must never be allowed to shape calculation logic. The most common misapplication is treating formula injection as a display-layer bug, which occurs when teams sanitise output while the backend still evaluates attacker-influenced pricing logic.

Related guidance in the NIST Cybersecurity Framework 2.0 reinforces the need to protect data integrity and validate business processes that depend on trusted inputs.

Examples and Use Cases

Implementing pricing controls rigorously often introduces tighter validation and more rigid workflow design, requiring organisations to weigh operational flexibility against the cost of preventing manipulative inputs.

  • A checkout system applies a user-supplied “discount code” field directly inside a totals formula, allowing the final price to be reduced beyond approved limits.
  • An e-commerce platform accepts quantity and unit-price fields from the browser, then recalculates order totals on the client side before sending the amount to the server.
  • A billing portal uses editable line-item formulas for enterprise customers, but fails to restrict who can alter rate variables, tax flags, or rounding rules.
  • A claims processing tool ingests spreadsheet-like expressions and evaluates them without strict formula parsing, letting malicious input change reimbursement amounts.
  • A low-code workflow automates fee calculation with hidden derived fields, yet trusts API payloads that overwrite those fields before the calculation step runs.

These scenarios overlap with broader application-security concerns, but the defining issue is calculation tampering. The OWASP Top 10 is useful context because formula injection often emerges where input handling and business logic controls are weak, even when the flaw does not fit neatly into one generic category. In many cases, the dangerous input is not obviously “malicious” at first glance, which makes parameter-level testing and server-side review essential.

Why It Matters for Security Teams

Formula injection matters because it undermines trust in financial outputs, entitlement decisions, and automated workflows. When attackers can influence calculation logic, they can cause underbilling, overbilling, unauthorised discounts, fraudulent claims, or distorted internal reporting. For security teams, the core control objective is not just sanitising fields, but ensuring that business-critical computations are deterministic, server-enforced, and insulated from user-controlled variables. That requires clear data-flow separation, explicit formula parsing, and approval boundaries for any calculation that can change money, access, or obligations.

In identity-linked systems, formula injection can also influence risk scoring, eligibility checks, or access gating when derived values feed downstream decisions. That makes the issue relevant to both application security and governance, especially where automated processes act on data from APIs, agents, or integrated services. The OWASP body of guidance is useful for framing secure input handling, while NIST Cybersecurity Framework 2.0 helps connect the flaw to integrity, monitoring, and recovery expectations. Organisations typically encounter the damage only after refunds, disputes, or revenue anomalies appear, at which point formula injection 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 address the attack and risk surface, while NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0PR.DSCSF data security outcomes cover integrity of trusted inputs and outputs.
OWASP Non-Human Identity Top 10NHI guidance highlights protection of machine-to-machine data paths that feed automation.
NIST SP 800-53 Rev 5SI-10Input validation control addresses unsafe acceptance of user-supplied data.

Protect calculation inputs and verify outputs so pricing logic cannot be altered by untrusted data.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on August 21, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org