/

CVE-2026-14749

Severity:

HIGH RISK

(7.3)

Code Injection (CWE-94) in Stumasy IMBA Calculator

CVE-2026-14749

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-74, CWE-94

Impact:

Remote Code Execution

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A remote code injection vulnerability in the Stumasy IMBA calculator allows attacker-controlled input in the mathematical_sentence parameter to be executed by the server.

When the application evaluates this parameter using unsafe patterns, an attacker sending crafted requests can execute arbitrary code with the web application's privileges.

Affected context

The vulnerability occurs in the eval function within application/pages/imba_calculator/calculate.php of the Stumasy application.

It is exposed when user-supplied expressions, such as the mathematical_sentence argument, are accepted from client requests and passed directly into evaluation logic on the server.

Environments that rely on this calculator functionality without strong input validation or isolation of evaluation routines are more likely to be affected, especially where the calculator endpoint is reachable over the network.

Exploit preconditions

  • Attack surface: HTTP request parameters reaching application/pages/imba_calculator/calculate.php
  • Required access: Remote access to the calculator endpoint; no local shell access is needed, and application-level authentication may or may not be enforced depending on deployment
  • Trigger point: Submission of a crafted mathematical_sentence value that is processed by the vulnerable eval function
  • Why exploitation is possible: The server-side code directly evaluates user-controllable input without restricting allowed operations, enabling arbitrary code execution within the application process

Why this happens

The core issue is the use of dynamic evaluation on untrusted data, aligning with CWE-94: Improper Control of Generation of Code and CWE-74: Improper Neutralization of Special Elements in Output.

In this case, the mathematical_sentence parameter is treated as executable content and passed to eval or equivalent logic that interprets the string as code rather than a purely mathematical expression.

Without strict whitelisting of allowable characters and operations or the use of a dedicated safe expression parser, attackers can inject language-level constructs, function calls, or system interactions that the runtime will execute.

This pattern generalizes to any scenario where user input is transformed into code or commands without comprehensive validation or sandboxing.

Potential impact

  • An attacker may execute arbitrary code in the context of the web server process.
  • The attacker could read or modify data handled by the application, including user records or configuration files.
  • The attacker may pivot to other components on the same host, potentially escalating privileges depending on system configuration.
  • The vulnerability could be used to deploy backdoors, web shells, or other persistent malicious logic.
  • The application's integrity can be compromised, allowing tampering with business logic or output.

General mitigation guidance

Effective mitigation focuses on eliminating direct code evaluation of user input and constraining any dynamic expression handling:

  • Replace eval-based logic with a dedicated, safe expression parser that supports only the required mathematical operations.
  • Apply strict input validation and canonicalization, using allowlists for acceptable characters, operators, and numeric formats; reject any input outside this constrained grammar.
  • Separate user-supplied data from execution contexts so that inputs are treated as values, not code; avoid constructing executable strings from request parameters.
  • Run the application under least-privilege accounts and consider isolation or sandboxing of components that must perform evaluation-like tasks to limit blast radius.
  • Adopt secure-by-default coding guidelines that forbid general-purpose evaluators and reflection-based execution paths for handling user data.

How teams detect issues like this

Detection can combine automated analysis with targeted review:

  • Use static analysis or linters to flag usage of dangerous functions (e.g., eval, exec, or similar dynamic evaluators) and highlight cases where arguments derive from request parameters.
  • During code review, search for calculator or expression-handling features and verify they rely on safe parsers rather than direct interpretation of user input.
  • Implement security-focused coding standards that prohibit dynamic evaluation constructs in web-exposed code, enforced via CI checks or pre-commit hooks.
  • Employ runtime application security monitoring or web application firewalls with rules tuned to detect and block anomalous expression payloads indicative of injection attempts.
  • Periodically perform penetration testing focusing on endpoints that interpret user-provided expressions, formulas, or scripts.

Sources

SourceLink
github.comgithub.com/mjperpinosa/stumasy/
github.comgithub.com/mjperpinosa/stumasy/issues/5
vuldb.comvuldb.com/cve/CVE-2026-14749
vuldb.comvuldb.com/submit/849414
vuldb.comvuldb.com/vuln/376338
vuldb.comvuldb.com/vuln/376338/cti

Frequently asked

questions

It is remotely exploitable wherever the vulnerable calculator endpoint is exposed over the network. Any attacker able to reach the endpoint and send crafted input can attempt exploitation, regardless of local access.

The attacker needs the ability to submit requests containing the mathematical_sentence parameter to the affected PHP page. Whether authentication is required depends on how the application is deployed, but exploitation does not require shell or system-level access beforehand.

The safest pattern is to eliminate dynamic code evaluation entirely for user-controlled data and replace it with a constrained expression parser. Inputs should be strictly validated against an allowlisted grammar that supports only the necessary mathematical operations, and code execution APIs should be removed from the request-handling path.

Prevention relies on secure design and coding practices: forbid eval and similar functions in application standards, use safe libraries for expression handling, enforce input validation by default, and integrate automated checks in CI to detect dynamic evaluation or untrusted-input-to-code flows before they reach production.

Find out what's already
exploitable in your codebase.