llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · @cyclonedx/cdxgen

GHSA-JGQW-XMHG-9RFM

Symbolic link at bom.json in a scanned repository makes cdxgen overwrite another file

Parche disponible
Descargar PNG JSON
CVSS
—
low
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche2 versionesPrimer parche el mismo día de la divulgación
Exposición15 dDesde la divulgación, 6 nov 2026, 12:11 a. m.
Detección12 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de la severidad declarada por GHSA (baja) y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Riesgo bajo, café alto.Hasta mi siesta tiene más impacto.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 12.9.1
Monitoreo
Detectada +1
6 nov 26
18 nov 26
21 nov 26
6 nov 26
10 nov 26
13 nov 26
17 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-JGQW-XMHG-9RFM divulgada
Remediación Parche 12.9.1 @cyclonedx/cdxgen · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Summary

When cdxgen wrote its output, it followed a symbolic link at the output path. A repository that commits `bom.json` as a link to another file made a scan from that checkout truncate the link's target and write the generated BOM into it. Node.js's permission model did not stop this, because it follows the link to a target outside `--allow-fs-write`.

Details

The CLI writes its BOM to `bom.json` by default, and in secure mode it places that file inside the scanned directory even when cdxgen runs from elsewhere. The write went through `safeWriteSync()`, which checked dry-run mode and write permission for the path and then called `writeFileSync()`. `writeFileSync()` opens the path with `O_TRUNC` and follows a symbolic link in its last component, so a committed link chose the file that was overwritten. A dangling link made cdxgen create its target. `cdx-sign` and `cdx-audit` wrote their output with `writeFileSync()` directly.

Proof of concept
mkdir -p /tmp/poc/project && cd /tmp/poc/project
printf 'SENTINEL\n' > ../victim.txt
printf '{"name":"demo","version":"1.0.0"}\n' > package.json
ln -s ../victim.txt bom.json
cdxgen --no-install-deps -t js .
head -c 40 ../victim.txt

`victim.txt` now holds the BOM and `bom.json` is still a link. The same happens with `CDXGEN_SECURE_MODE=true node --permission --allow-fs-write=/tmp/poc/project/bom.json ...`.

Impact

A malicious repository can overwrite any file that the user running the scan can write and whose path it can predict, such as configuration, cache or workspace files on a CI runner. The written bytes are the generated BOM, not attacker-chosen content, so the effect is corruption and denial of service in later steps rather than direct code execution.

Patches

Fixed in `@cyclonedx/cdxgen` 12.9.1 (#4758, commits e45cc3d https://github.com/cdxgen/cdxgen/commit/e45cc3db5bde912de56f7564cd5718a2c5b7e827 and 63fc7ca https://github.com/cdxgen/cdxgen/commit/63fc7ca41678ad09158a525b7a9fccb61305f7e3). The fix for `@cdxgen/cdxgen` is in #4759 (commit a1ede52 https://github.com/cdxgen/cdxgen/commit/a1ede52847f3e007b01d2f80ce72c43f7856c9dc) and will ship in 13.7.0. `safeWriteSync()` now removes a symbolic link in the last component of the path and creates a regular file in its place, with a warning. The file is opened with `O_NOFOLLOW` where the platform has it, so a link that appears after the check makes the write fail. Paths under `/dev` and `/proc`, such as `/dev/stdout`, are written as given. `cdx-sign` and `cdx-audit` write through `safeWriteSync()` too. The behaviour was checked on Node.js, Bun and Deno.

Workarounds

Pass `-o` with a path outside the checkout, or remove `bom.json` from the checkout before scanning.

Credits

Reported by @andife.

References
  • https://github.com/cdxgen/cdxgen/pull/4758
  • https://github.com/cdxgen/cdxgen/pull/4759

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida Última
@cyclonedx/cdxgen≥ 8.1.6 < 12.9.1
@cyclonedx/cdxgen≥ 13.0.0 < 13.7.0
8.1.6
12.9.1
12.9.2
13.0.0
13.7.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npm@cyclonedx/cdxgen
Corregida 12.9.1 0 d 12.9.2 no afectada
Versiones corregidas12.9.113.7.0
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/cdxgen/cdxgen/security/advisories/GHSA-jgqw-xmhg-9rfm

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.