/

CVE-2026-51917

Severity:

HIGH RISK

(7.3)

Code Injection (CWE-94) in FinRobot CodingUtils.modify_code

CVE-2026-51917

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Potential Arbitrary 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

FinRobot v1.0.0 contains a code injection vulnerability in the

CodingUtils.modify_code component. If attacker-controlled input reaches

the code modification workflow and is subsequently executed, an attacker

may influence application behavior or achieve arbitrary code execution.

FinRobot v1.0.0 contains a code injection vulnerability in the

CodingUtils.modify_code component. If attacker-controlled input reaches

the code modification workflow and is subsequently executed, an attacker

may influence application behavior or achieve arbitrary code execution.

Affected context

The vulnerability occurs in deployments using FinRobot v1.0.0 where the

CodingUtils.modify_code functionality processes input that is not fully

trusted. Risk depends on whether modified code is evaluated or executed and

on the privileges available to the FinRobot process.

The vulnerability occurs in deployments using FinRobot v1.0.0 where the

CodingUtils.modify_code functionality processes input that is not fully

trusted. Risk depends on whether modified code is evaluated or executed and

on the privileges available to the FinRobot process.

Exploit preconditions

  • Attack surface: The CodingUtils.modify_code code-generation or

modification workflow

  • Required access: Ability to supply or influence input processed by

that workflow

  • Trigger point: Processing and subsequent evaluation or execution of

modified code

  • Why exploitation is possible: Input may cross into an executable code

context without sufficient separation, validation, or trust-boundary

enforcement

  • Attack surface: The CodingUtils.modify_code code-generation or

modification workflow

  • Required access: Ability to supply or influence input processed by

that workflow

  • Trigger point: Processing and subsequent evaluation or execution of

modified code

  • Why exploitation is possible: Input may cross into an executable code

context without sufficient separation, validation, or trust-boundary

enforcement

Why this happens

The underlying issue is an unsafe transition from attacker-influenced data to

executable program logic. This behavior maps to CWE-94: Improper Control of Generation of Code ('Code Injection'), in which application input can

affect generated or modified code that is later interpreted or executed.

The underlying issue is an unsafe transition from attacker-influenced data to

executable program logic. This behavior maps to CWE-94: Improper Control of Generation of Code ('Code Injection'), in which application input can

affect generated or modified code that is later interpreted or executed.

Potential impact

  • An attacker may execute unintended code with the privileges of the

FinRobot process.

  • Sensitive files, environment variables, or credentials could be exposed.
  • Application data or generated artifacts could be altered.
  • The affected host or workload could be used for further compromise.
  • An attacker may execute unintended code with the privileges of the

FinRobot process.

  • Sensitive files, environment variables, or credentials could be exposed.
  • Application data or generated artifacts could be altered.
  • The affected host or workload could be used for further compromise.

General mitigation guidance

Mitigation generally focuses on preventing untrusted data from becoming

executable code.

Common defensive patterns include:

  • Prefer structured operations and fixed code templates over dynamic code

generation or execution.

  • Apply strict allowlists and schema validation to inputs that influence code

modifications.

  • Separate generated content from executable paths and require explicit,

isolated review before execution.

  • Run code-processing workloads with least privilege and restricted access to

secrets, filesystems, and network services.

  • Enforce trust boundaries through sandboxing and secure-by-default execution

policies where code execution is necessary.

Mitigation generally focuses on preventing untrusted data from becoming

executable code.

Common defensive patterns include:

  • Prefer structured operations and fixed code templates over dynamic code

generation or execution.

  • Apply strict allowlists and schema validation to inputs that influence code

modifications.

  • Separate generated content from executable paths and require explicit,

isolated review before execution.

  • Run code-processing workloads with least privilege and restricted access to

secrets, filesystems, and network services.

  • Enforce trust boundaries through sandboxing and secure-by-default execution

policies where code execution is necessary.

How teams detect issues like this

Detection approaches may include:

  • Static analysis for dynamic evaluation, runtime compilation, shell execution,

and string concatenation used to construct executable code.

  • Code review checks for flows from user-controlled or external inputs into

modify_code and subsequent execution APIs.

  • Policy enforcement that blocks unrestricted dynamic code execution in

production workloads.

  • Runtime monitoring for unexpected child processes, file changes, or network

activity from FinRobot workers.

  • Automated security review tools can help identify input-to-code execution

paths during development.

Detection approaches may include:

  • Static analysis for dynamic evaluation, runtime compilation, shell execution,

and string concatenation used to construct executable code.

  • Code review checks for flows from user-controlled or external inputs into

modify_code and subsequent execution APIs.

  • Policy enforcement that blocks unrestricted dynamic code execution in

production workloads.

  • Runtime monitoring for unexpected child processes, file changes, or network

activity from FinRobot workers.

  • Automated security review tools can help identify input-to-code execution

paths during development.

Sources

SourceLink
gist.github.comgist.github.com/Ro1ME/282d3710f47d26399cbe93249aac3c09
github.comgithub.com/AI4Finance-Foundation/FinRobot/issues/101

Frequently asked

questions

Exploitability depends on how CodingUtils.modify_code is exposed. It may be

reachable remotely when untrusted users or services can submit input to the

relevant workflow; otherwise, local or authenticated access may be required.

An attacker generally needs the ability to influence input that the component

uses to generate or modify code, plus a code path that evaluates or executes

the resulting content.

Avoid executing dynamically generated code. Use constrained templates,

structured data, strict validation, and isolated execution when dynamic

behavior is unavoidable.

Establish clear data-to-code trust boundaries, review dynamic execution paths,

apply least privilege, and enforce static and runtime policies that restrict

unauthorized code execution.

Exploitability depends on how CodingUtils.modify_code is exposed. It may be

reachable remotely when untrusted users or services can submit input to the

relevant workflow; otherwise, local or authenticated access may be required.

An attacker generally needs the ability to influence input that the component

uses to generate or modify code, plus a code path that evaluates or executes

the resulting content.

Avoid executing dynamically generated code. Use constrained templates,

structured data, strict validation, and isolated execution when dynamic

behavior is unavoidable.

Establish clear data-to-code trust boundaries, review dynamic execution paths,

apply least privilege, and enforce static and runtime policies that restrict

unauthorized code execution.

Find out what's already
exploitable in your codebase.