Skip to main content
MediumSupply chainOWASP A05:2021CWE-540

How to fix: CI workflow definition publicly served

The response is a CI workflow definition with a jobs block and action steps. That is the shape GitHub Actions and compatible runners use, including runner labels and triggers.

Why it matters

The workflow names every secret the pipeline reads, and while the values are not present the names tell an attacker exactly which credentials exist and what they are for. It also discloses the deployment target, the registry the build pushes to, whether self-hosted runners are used and with what labels, and which branches and events trigger a deploy. Self-hosted runner labels are the most immediately useful of those: they identify machines inside your network that execute code on a push.

Workflow files are public for any public repository, so this is only a disclosure where the repository is private. Either way, a workflow served from the application origin means the repository was deployed rather than the build output, so the same document root likely holds other repository files. The pipeline detail is also worth reviewing on its own merits: pull_request_target triggers and unpinned third-party actions are the two things attackers look for here.

How to fix it

  1. 1Stop deploying the repository; publish only the build output.
  2. 2Review the workflow for pull_request_target triggers combined with checkout of untrusted code, which is a well-known privilege-escalation shape.
  3. 3Confirm no self-hosted runner it names is reachable from outside your network.
  4. 4Rotate any secret whose purpose the file reveals if you cannot rule out that the values were also exposed.

Code examples

Find repository files under the served root

bash
curl -s -o /dev/null -w '%{http_code}\n' https://example.com/.github/workflows/deploy.yml
curl -s -o /dev/null -w '%{http_code}\n' https://example.com/.git/config

Nginx: deny dot-directories

nginx
location ~ /\. {
    deny all;
    return 404;
}

References

Detected automatically by VulnRadar. The check id is supply-chain-ci-workflow-exposed, stable across every scan so you can filter or diff on it.

See every supply chain check

Questions

How severe is CI workflow definition publicly served?
VulnRadar rates this medium severity in the supply chain category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id supply-chain-ci-workflow-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does CI workflow definition publicly served map to?
It maps to CWE-540. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for ci workflow definition publicly served

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

CI workflow definition publicly served fix | VulnRadar