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:
- a Stratum URL:
stratum+tcp://,stratum+ssl://orstratum+tls://, the protocol miners use to reach a pool and nothing else uses; - a known mining-pool host, as the domain itself or any subdomain of it:
supportxmr,minexmr,moneroocean,nanopool,hashvault,c3pool,herominers,2minersandunmineableunder.com,.org,.net,.streamor.pro(for examplegulf.moneroocean.stream:10128orpool.hashvault.pro:443).
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:
- building or cloning a miner, such as
git clone --recursive https://github.com/xmrig/xmrig.git && … make; - an image reference such as
image: strm/xmrig; - a pool URL that only appears in an
echo/printfstring or a comment.
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:
- find who or what pushed the change;
- rotate the tokens that could push pipeline changes (project, group and deploy tokens, and runner registration tokens);
- review recent pipelines for other abuse.
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