glsec

Rules / GL093

GL093 interpreter runs a file disguised with a non-script extension

Severity: error
OWASP: CICD-SEC-4 – Poisoned Pipeline Execution
CWE: CWE-506 – Embedded Malicious Code

Risk

An interpreter (node, python, ruby, bun, deno, …) run on a file whose extension is a data, asset or document type — a font, image, PDF, log and so on — is almost never legitimate: those files are not code. The mismatch is the disguise. A reviewer skims past fa-brands-400.ttf as a font, but when a job runs node …/fa-brands-400.ttf, the "font" is obfuscated JavaScript that executes with the job's environment, tokens and runner access.

This is the shape of the PolinRider campaign, which hid obfuscated JavaScript inside files named like Font Awesome assets (fa-brands-400.ttf, .woff2, …) and ran them from a committed task. The same line fits a script: block directly.

Trigger example

build:
  script:
    - node assets/fa-brands-400.ttf

Flagged: an interpreter (node, nodejs, deno run, bun / bun run, python / python2 / python3, ruby, perl, php, Rscript, osascript, pwsh / powershell), optionally with a path and flags, whose file argument ends in a data/asset/document extension: .ttf .otf .woff .woff2 .eot .png .jpg .jpeg .gif .ico .bmp .svg .webp .pdf .csv .tsv .dat .bin .log .md .txt .lock.

What is not flagged

Safe alternative

build:
  script:
    - node scripts/build.js

Keep executable code in files with the interpreter's own script extension, and keep fonts, images and other assets as data the pipeline reads but never runs.

Notes

References

Documentation for glsec 1.29.0. Source of this page · Rule implementation