Path Traversal in github.com/infracost/infracost (CVE-2026-71493)
Summary
Path traversal in github.com/infracost/infracost (CVE-2026-71493). Risk of unauthorized operations or information disclosure. Exploitable via readFile. Mitigation: upgrade to 0.10.45 or later.
Original description
The description as published by the source.
Impact
Path traversal via link following in the Infracost config-template parser. The readFile, pathExists, isDir, and matchPaths template functions confined repo-supplied paths with a lexical filepath.Rel check plus a leaf-only os.Lstat:
{{ readFile "evil/file" }}
With an intermediate directory symlink committed in the repo (evil -> /), the path is lexically clean and the leaf is a regular file, so both checks pass, but os.ReadFile follows the symlink and reads outside the checkout. The contents are rendered into the generated config and surfaced via the Infracost dashboard and PR comment, so anyone who can open a pull request can read files off the runner.
Affects infracost up to and including v0.10.44. Successful exploitation reads any file the CLI process can reach on the runner. Impact depends on what the run exposes: under on: pull_request (the configuration in Infracost's documentation) fork pull requests run without secrets and with a read-only token, so exposure is limited. If Infracost runs under pull_request_target, or is triggered by a same-repository pull request, the read reaches the repository's secrets, enabling secret theft. The patch confines all four functions regardless of trigger.
Patches
Fixed in v0.10.45 (#3586) by routing all four functions through security.IsPathAllowed, which resolves symlinks anywhere in the path before a segment-aware containment c…
Source: NIST National Vulnerability Database NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-71493 has been found in github.com/infracost/infracost.
Attackers can target a specific entry point like readFile over the network to misuse the product.
Risk of unauthorized operations or information disclosure.
What to do: upgrade github.com/infracost/infracost to 0.10.45 or later.
If unsure, ask your IT team or search "github.com/infracost/infracost CVE-2026-71493" on the vendor's site.
CVE-2026-71493 (github.com/infracost/infracost) — CWE-22
Attack surface: readFile / pathExists / isDir / matchPaths
Patched: 0.10.45 — apply immediately
Workaround: No full fix without upgrading.
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
Path traversal (CWE-22) exists in github.com/infracost/infracost. Attackers reach the vulnerable code path via readFile.
Check the vendor advisory for the affected versions of github.com/infracost/infracost. Attack surface: readFile / pathExists / isDir / matchPaths.
Severity: ?. Risk of unauthorized operations or information disclosure.
Update to 0.10.45.
Workaround: No full fix without upgrading.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'github.com/infracost/infracost' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'github.com/infracost/infracost' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
github.com/infracost/infracostを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply temporary workaround mitigate
No full fix without upgrading.パッチが適用されるまでの応急処置として、No full fix without upgrading. を実施。回避策の副作用 (機能低下) を確認した上で。
-
3Apply patch patch
Upgrade github.com/infracost/infracost to 0.10.45ステージング環境で 0.10.45 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。