CVE-2026-44287
JSON

6.3medium

FastGPT: sandbox escape to RCE - code-sandbox regex /\bimport\s*\(/ is bypassable

Severity
6.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.24% (higher than 16% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

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.

Affected

Product or packageVersionsReported by
labring FastGPT< 4.15.0-beta1CVE List

Classification

CWE-94CWE-184

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

FastGPT es una plataforma de creación de agentes de IA. Antes de 4.15.0-beta1, el worker de JavaScript del sandbox en projects/code-sandbox/src/pool/worker.ts:356 bloquea la importación dinámica import() con la expresión regular /\bimport\s*\(/.test(code). La sintaxis de JavaScript acepta un comentario de bloque entre import y (; la expresión regular solo coincide con espacios en blanco ASCII, y los bytes /, *, *, / no están en la clase de caracteres \s. La carga útil import/**/("child_process") se analiza como una importación dinámica sintácticamente válida que la expresión regular no detecta. Debido a que import() no está envuelto por el Proxy safeRequire (que solo proxyfica require), el atacante carga child_process y llama a execSync - ejecución de comandos arbitrarios como uid=100(sandbox) dentro del contenedor del sandbox. Esta vulnerabilidad está corregida en 4.15.0-beta1.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-44287 changed 2026-06-01CVE Terms of Use
NVDCVE-2026-44287 changed 2026-07-22Public domain