{"id":"CVE-2026-71493","aliases":["CVE-2026-71493","GHSA-mmg6-4qmv-6pc8","GO-2026-6439"],"related":[],"kind":"vulnerability","state":"published","title":"Infracost: Arbitrary file read via config-template readFile symlink traversal","summary":"Infracost provides cloud cost intelligence for engineers, AI coding agents, and CI/CD. Prior to 0.10.45, the readFile, pathExists, isDir, and matchPaths template functions in internal/config/template/parser.go use a lexical filepath.Rel check and a leaf-only os.Lstat check that do not resolve an intermediate directory symlink. A repository can contain a path such as evil/file where evil points outside the checkout, causing os.ReadFile and related operations to follow the symlink and read runner-accessible files. The resulting content is rendered into generated configuration and can be surfaced through the Infracost dashboard or pull request comment, with greater impact in workflows that provide repository secrets. This issue is fixed in version 0.10.45.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Infracost provides cloud cost intelligence for engineers, AI coding agents, and CI/CD. Prior to 0.10.45, the readFile, pathExists, isDir, and matchPaths template functions in internal/config/template/parser.go use a lexical filepath.Rel check and a leaf-only os.Lstat check that do not resolve an intermediate directory symlink. A repository can contain a path such as evil/file where evil points outside the checkout, causing os.ReadFile and related operations to follow the symlink and read runner-accessible files. The resulting content is rendered into generated configuration and can be surfaced through the Infracost dashboard or pull request comment, with greater impact in workflows that provide repository secrets. This issue is fixed in version 0.10.45.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nPath 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`:\n\n```\n{{ readFile \"evil/file\" }}\n```\n\nWith 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.\n\nAffects `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.\n\n### Patches\n\nFixed in `v0.10.45` ([#3586](https://github.com/infracost/infracost/pull/3586)) by routing all four functions through `security.IsPathAllowed`, which resolves symlinks anywhere in the path before a segment-aware containment check. The same fix landed in [config#14](https://github.com/infracost/config/pull/14) and [parser#144](https://github.com/infracost/parser/pull/144).\n  - Installed via the official script, a package manager, or the `latest` Docker tag: upgrade to `v0.10.45` (or later) to receive the fix.\n  - Pinned to a specific version or image digest: bump to `v0.10.45`.\n\n### Workarounds\n\nNo full fix without upgrading. To limit exposure: run Infracost under `on: pull_request` rather than `pull_request_target`, and keep fork pull requests from receiving secrets (the defaults).","format":"markdown","source":"ghsa"},{"lang":"en","text":"Infracost: Arbitrary file read via config-template readFile symlink traversal in github.com/infracost/infracost","format":"markdown","source":"go"},{"lang":"es","text":"Infracost proporciona inteligencia de costos en la nube para ingenieros, agentes de codificación de IA y CI/CD. Antes de la versión 0.10.45, las funciones de plantilla readFile, pathExists, isDir y matchPaths en internal/config/template/parser.go utilizan una verificación léxica filepath.Rel y una verificación os.Lstat solo de hoja que no resuelven un enlace simbólico de directorio intermedio. Un repositorio puede contener una ruta como evil/file donde evil apunta fuera del checkout, haciendo que os.ReadFile y operaciones relacionadas sigan el enlace simbólico y lean archivos accesibles para el ejecutor. El contenido resultante se renderiza en la configuración generada y puede mostrarse a través del panel de Infracost o un comentario de solicitud de extracción, con mayor impacto en flujos de trabajo que proporcionan secretos de repositorio. Este problema se corrige en la versión 0.10.45.","source":"nvd"}],"published":"2026-08-21T17:52:29.001Z","modified":"2026-10-14T19:10:00.297Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"}],"cwes":["CWE-22","CWE-59"],"affected":[{"ranges":[{"version":"< 0.10.45","status":"affected"}],"vendor":"infracost","product":"infracost","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.10.45"}],"ecosystem":"Go","package":"github.com/infracost/infracost","purl":"pkg:golang/github.com/infracost/infracost","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.10.45"}],"ecosystem":"Go","package":"github.com/infracost/infracost","purl":"pkg:golang/github.com/infracost/infracost","source":"go"}],"references":[{"url":"https://github.com/infracost/infracost/security/advisories/GHSA-mmg6-4qmv-6pc8","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/infracost/infracost/pull/3586","tags":["fix","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/infracost/infracost/commit/4d39331afc0e27752d16d9d91c34583e5e8487fb","tags":["fix","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/infracost/infracost/releases/tag/v0.10.45","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-71493","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/infracost/infracost","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-08-26T17:33:05.338Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-71493","url":"https://www.cve.org/CVERecord?id=CVE-2026-71493","licence":"CVE Terms of Use","modified":"2026-08-26T17:33:14.286Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mmg6-4qmv-6pc8","url":"https://github.com/advisories/GHSA-mmg6-4qmv-6pc8","licence":"CC-BY-4.0","modified":"2026-09-10T15:25:35.065Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6439","url":"https://pkg.go.dev/vuln/GO-2026-6439","licence":"CC-BY-4.0","modified":"2026-09-10T15:15:15.758Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-71493","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-71493","licence":"Public domain","modified":"2026-10-14T19:10:00.297Z"}],"updatedAt":"2026-11-25T22:59:34.807Z","epss":{"score":0.00544,"percentile":0.39302,"date":"2026-11-30T12:00:22.000Z"}}