All news · Lire en français

GitLab CI: Command Injection and Risks on Shared Runners

By Mounim Alami — Founder of CybRelay ·

GitLab CI: Command Injection and Risks on Shared Runners

The GitLab 17.4 security release reveals a critical vulnerability that allows unauthorized command execution on production runners. This attack vector directly exposes the software supply chain to shared cache poisoning and build pipeline compromise.

What Happened

According to disclosures in the GitLab Security Release (17.4), a critical vulnerability was identified in GitLab CI's execution architecture. The flaw allows an untrusted contribution to execute arbitrary code with all the access permissions assigned to the production runner.

Exploitation of this command injection grants direct access to shared cache directories used during continuous integration stages. Scanners operating without deterministic validation fail to catch this type of injection, leaving operational build workflows exposed to unverified execution.

Who Is Affected

This issue impacts all organizations relying on GitLab CI to build, test, and package applications using shared runners across multiple projects or branches. Technology firms, financial organizations operating under strict digital integrity rules, and healthcare or public sector institutions are particularly exposed.

Software engineering teams and DevSecOps departments across Europe, Morocco, and the wider African continent that pool build infrastructure to optimize technical resources are directly affected.

Why It Is Dangerous

Executing arbitrary commands with production runner privileges creates a serious risk of software supply chain poisoning. Once a shared runner is compromised, an attacker can alter compiled artifacts or corrupt shared build caches leveraged by subsequent company pipelines.

This technique allows malicious payloads to be injected into legitimate software components without immediate detection by developers. Furthermore, standard vulnerability scanners lacking deterministic validation regularly miss pipeline injections, fostering a false sense of protection across engineering teams.

What To Do Now

Several immediate steps should be implemented to mitigate this threat across infrastructure setups:

1. Immediately apply the updates provided in the GitLab Security Release (17.4) across all hosted instances.

2. Strictly segregate CI runners handling untrusted contributions or unverified branches, ensuring they do not share caches or storage volumes with production runners.

3. Audit the integrity of existing shared caches and flush temporary directories used by recent pipeline executions.

4. Enforce rigorous integrity checks and digital verification on all generated build artifacts prior to release.

How CybRelay Helps

CybRelay enables engineering teams to protect their developments through its SaaS platform for vulnerability analysis and remediation, covering 18 programming languages alongside Terraform, Kubernetes, and Dockerfile infrastructure configurations. By invoking CybRelay through its v1 API as a blocking pipeline gate, organizations consolidate third-party security reports (SARIF, Semgrep, Trivy, SonarQube) and deduplicate findings into P1 to P4 priorities.

For each vulnerability, CybRelay provides a detailed report and an automated fix script in Bash or Python written by its deterministic engine, supplemented by AI guidance in comments. A .patch file is generated only when verified in memory. CybRelay does not connect to or clone any repository; data is hosted in the European Union (Belgium) and purged within 48 hours. Fifty free credits are available at cybrelay.com without requiring a credit card, enabling external website exposition audits and initial scan analyses.

Standards and laws involved

  • Directive NIS2 — European Directive (EU) 2022/2555 on the cybersecurity of essential and important entities. The directive requires essential and important entities to implement strict security controls across their software supply chains and build environments.
  • Règlement DORA — European Regulation (EU) 2022/2554 on digital operational resilience for the financial sector. The framework mandates strict control by financial institutions over digital risks arising from third-party tools and critical build systems.
  • ISO/IEC 27001 — International standard defining an information security management system. The standard emphasizes technical vulnerability management and the robust segregation of development and integration environments.
  • OWASP Top 10 — Reference list of the ten most critical security risks for web applications, published by the OWASP Foundation. This flaw directly involves software and data integrity failures alongside unconstrained command injections.

Frequently asked questions

How can a shared runner compromise an unrelated project?

By gaining access to shared cache storage or pooled temporary disks, unauthorized commands can alter cached packages or binaries reused by subsequent builds of other projects.

Does CybRelay require direct read access to GitLab repositories?

No. CybRelay never connects to or clones any code repository. Files, scanner outputs, or infrastructure templates are submitted directly via API calls, web input, or the MCP gateway.

Source : GitLab Security Release (17.4)