Atlantis: Arbitrary File Read by Bypassing the var-file Allowlist

Anyone who may comment in a connected repository bypasses the allowlist with --var-file and reads every file the Atlantis process can read.

Advisory ID: TP-2026-155
Product: Atlantis (Terraform automation through pull requests)
Vulnerability type: Path traversal through a bypass of the --var-file allowlist (CWE-22)
CVE: not requested
CVSS 3.1: 6.5 (Medium) · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Vendor advisory: GHSA-chm7-fjpm-927x
Affected versions: 0.19.5 up to but not including 0.49.0 (verified live: 0.46.0)
Fixed in: 0.49.0
Reported: 15 August 2026

Summary

Atlantis runs Terraform from pull request comments and passes everything that follows -- in the comment on to Terraform. To keep a comment from loading arbitrary server files through -var-file, the server option --var-file-allowlist restricts such paths to approved directories, by default the data directory. The check recognizes only the single-dash spelling, while Terraform accepts --var-file with two dashes just the same. Terraform prints a file that is not valid HCL line by line in its error messages, and Atlantis writes that output into the pull request. Anyone who may comment in a connected repository reads every file the Atlantis process can read.

Root cause

Line numbers refer to 0.46.0: VarFileAllowlistChecker.Check recognizes only the token -var-file followed by an argument (server/events/var_file_allowlist_checker.go:40) and the form -var-file=<path>, which it splits into exactly two parts with strings.Split(flag, "=") (server/events/var_file_allowlist_checker.go:44-48).
For --var-file=<path> the first part is --var-file, the comparison fails, the path stays unchecked and reaches Terraform unchanged, which treats both spellings alike.
There is no second gate, because the comment parser passes everything after -- on verbatim (server/events/comment_parser.go:206), and DefaultBlockedExtraArgs lists -chdir and --chdir but no form of var-file (server/events/comment_parser.go:50-55).
isAllowedPath also allows every relative path that does not start with .. or ~ without resolving symbolic links (server/events/var_file_allowlist_checker.go:63-67), so a link committed in the pull request that points to a file outside the allowlist passes the check.
checkVarFilesInPlanCommandAllowlisted applies the check to plan only (server/events/command_runner.go:411-418).

Proof of Concept

# Comment on the pull request
atlantis plan -- --var-file=<path outside the allowlist>

# The same call measured directly in the container
$ terraform plan --var-file=/home/atlantis/.git-credentials
Error: Argument or block definition required
  on /home/atlantis/.git-credentials line 1:
   1: https://atlantisbot:[email protected]

The file lies outside the default allowlist /home/atlantis/.atlantis and is printed in clear text anyway; Atlantis writes the Terraform output into the pull request. Verified in the container ghcr.io/runatlantis/atlantis:v0.46.0 with Terraform v1.14.9 and an account that may only read and comment in the repository (push: false); the single-dash spelling is rejected as the control. .git-credentials exists only with the option --write-git-creds; in the default configuration /proc/self/environ yields ATLANTIS_GH_TOKEN, ATLANTIS_API_SECRET and ATLANTIS_GH_WEBHOOK_SECRET, measured end to end with a single comment.

Impact

  • Read access to every file the Atlantis process can read with a single comment; Terraform prints one error message per line, so the complete file.
  • In the default configuration, disclosure of the VCS token, the API secret and the webhook secret from the process environment.
  • Comment rights are enough: in the test the GitHub role with read-only access sufficed, without write access to the repository.
  • The documented protection --var-file-allowlist has no effect, including in the default configuration.

References

Is Something Like This in Your Software?

Our team found this vulnerability during its work. Have your applications tested by the same specialists, with a penetration test from turingpoint.