CWE-94: Improper Control of Generation of Code ('Code Injection') in labring FastGPT (CVE-2026-44287)
FastGPT is an AI Agent building platform. Prior to 4.15.0-beta1, the JavaScript sandbox worker at projects/code-sandbox/src/pool/worker.ts:356 blocks dynamic import() with the regex /\bimport\s*\(/.test(code). JavaScript syntax accepts a block comment between import and (; the regex matches only ASCII whitespace, and the bytes /, *, *, / are not in the \s character class. The payload import/**/("child_process") parses as a syntactically valid dynamic import that the regex does not detect. Because import() is not wrapped by the safeRequire Proxy (which only proxies require), the attacker loads child_process and calls execSync - arbitrary command execution as uid=100(sandbox) inside the sandbox container. This vulnerability is fixed in 4.15.0-beta1.
AI Analysis
Technical Summary
FastGPT's JavaScript sandbox worker attempts to block dynamic import() calls using a regex that only matches ASCII whitespace between 'import' and '('. However, JavaScript syntax permits block comments in this position, which the regex does not account for. An attacker can craft a payload like import/**/("child_process") that is syntactically valid but bypasses the regex filter. Since dynamic import() calls are not wrapped by the safeRequire Proxy (which only proxies require calls), this allows loading the child_process module and executing commands via execSync within the sandbox container running as uid=100. This vulnerability enables arbitrary command execution within the sandbox environment. The issue is resolved in FastGPT version 4.15.0-beta1.
Potential Impact
An attacker exploiting this vulnerability can execute arbitrary commands inside the sandbox container with uid=100 privileges by bypassing the dynamic import() filter and loading the child_process module. This can lead to unauthorized code execution and potential compromise of the sandbox environment. The CVSS score is 6.3 (medium severity), reflecting network attack vector, low complexity, requiring low privileges, no user interaction, and impacts on confidentiality, integrity, and availability.
Mitigation Recommendations
This vulnerability is fixed in FastGPT version 4.15.0-beta1. Users should upgrade to version 4.15.0-beta1 or later to remediate this issue. No other official remediation or temporary fixes are documented. Patch status is not explicitly stated beyond the fix in 4.15.0-beta1; therefore, verify the vendor advisory for the latest remediation guidance.
CWE-94: Improper Control of Generation of Code ('Code Injection') in labring FastGPT (CVE-2026-44287)
Description
FastGPT is an AI Agent building platform. Prior to 4.15.0-beta1, the JavaScript sandbox worker at projects/code-sandbox/src/pool/worker.ts:356 blocks dynamic import() with the regex /\bimport\s*\(/.test(code). JavaScript syntax accepts a block comment between import and (; the regex matches only ASCII whitespace, and the bytes /, *, *, / are not in the \s character class. The payload import/**/("child_process") parses as a syntactically valid dynamic import that the regex does not detect. Because import() is not wrapped by the safeRequire Proxy (which only proxies require), the attacker loads child_process and calls execSync - arbitrary command execution as uid=100(sandbox) inside the sandbox container. This vulnerability is fixed in 4.15.0-beta1.
CVSS v3.1
Score 6.3medium
Affected software
pkg:github/labring/FastGPTRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
FastGPT's JavaScript sandbox worker attempts to block dynamic import() calls using a regex that only matches ASCII whitespace between 'import' and '('. However, JavaScript syntax permits block comments in this position, which the regex does not account for. An attacker can craft a payload like import/**/("child_process") that is syntactically valid but bypasses the regex filter. Since dynamic import() calls are not wrapped by the safeRequire Proxy (which only proxies require calls), this allows loading the child_process module and executing commands via execSync within the sandbox container running as uid=100. This vulnerability enables arbitrary command execution within the sandbox environment. The issue is resolved in FastGPT version 4.15.0-beta1.
Potential Impact
An attacker exploiting this vulnerability can execute arbitrary commands inside the sandbox container with uid=100 privileges by bypassing the dynamic import() filter and loading the child_process module. This can lead to unauthorized code execution and potential compromise of the sandbox environment. The CVSS score is 6.3 (medium severity), reflecting network attack vector, low complexity, requiring low privileges, no user interaction, and impacts on confidentiality, integrity, and availability.
Mitigation Recommendations
This vulnerability is fixed in FastGPT version 4.15.0-beta1. Users should upgrade to version 4.15.0-beta1 or later to remediate this issue. No other official remediation or temporary fixes are documented. Patch status is not explicitly stated beyond the fix in 4.15.0-beta1; therefore, verify the vendor advisory for the latest remediation guidance.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-05T17:39:31.112Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
- Gcve Source
- db.gcve.eu
Threat ID: 6a19feb1e29bf47b500fc26f
Added to database: 05/29/2026, 21:01:37 UTC
Last enriched: 05/29/2026, 21:03:02 UTC
Last updated: 07/31/2026, 19:22:59 UTC
Views: 63
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.