glsec

Rules / GL096

GL096 Script connects to a cryptocurrency mining pool

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

What glsec checks

CI-minute cryptojacking runs a miner on the project's runners. It typically arrives through a leaked CI token that can push a pipeline change, or through a malicious merge request or fork pipeline. It is abuse, not hygiene, so glsec reports it as an error.

glsec looks at every script surface (script:, before_script:, after_script:, default:, hooks:, run: steps) and reports a command that connects to a mining pool:

Matching ignores case. A host only matches as a whole domain, so notsupportxmr.com and supportxmr.com.example.org don't.

Only the pool connection is reported. The bare tool name (xmrig, cpuminer) never triggers the rule, so these stay silent:

A pool host kept in a variable and passed as $POOL is not resolved.

Trigger example(s)

mine:
  script:
    - xmrig -o stratum+tcp://pool.supportxmr.com:3333 -u WALLET
mine:
  script:
    - nohup ./xmrig -o gulf.moneroocean.stream:10128 -u WALLET > /dev/null 2>&1 &

Safe alternative

There is no safe form of mining on CI runners. Remove the job. Then treat it as an incident:

Building or packaging a miner as a project is fine and is not reported, as long as the pipeline never points it at a pool.

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