Terrascan v1.18.3 and prior are vulnerable to Server-Side Request Forgery (SSRF) via the remote_url parameter in the remote directory scan endpoint (POST /v1/{iac}/{iacVersion}/{cloud}/remote/dir/scan) when running in server mode. An unauthenticated remote attacker can supply an attacker-controlled HTTP URL as remote_url with remote_type set to "http". The URL is passed directly to hashicorp/go-getter (v1.7.5) without validation. Go-getter's HttpGetter supports the X-Terraform-Get response header, allowing the attacker's server to redirect the download to a file:// URL, enabling local file read. Additionally, HttpGetter has Netrc set to true, causing it to read ~/.netrc and send stored credentials to attacker-controlled hostnames. This affects deployments running terrascan in server mode (terrascan server), which binds to 0.0.0.0 with no authentication. Note: Terrascan was archived in August 2023 and no patch will be released.
The vulnerability exists in Terrascan's server mode (terrascan server), which by default listens on 0.0.0.0 without any authentication mechanism. An attacker sends a POST request to the /v1/{iac}/{iacVersion}/{cloud}/remote/dir/scan endpoint, providing an attacker-controlled HTTP address as the remote_url parameter value with remote_type set to 'http'. The URL is passed directly to the hashicorp/go-getter library (v1.7.5) without any validation. The go-getter library supports the X-Terraform-Get response header, which allows an attacker's server to redirect the download to a file:// address, enabling local file reading. Additionally, the HttpGetter component has the Netrc option enabled (true), so it reads the ~/.netrc file and sends the credentials stored in it to the attacker-controlled server.
An unauthenticated remote attacker can read arbitrary local files accessible to the Terrascan process and steal credentials (usernames, passwords, tokens) stored in the ~/.netrc file on the server, which may lead to further infrastructure security breaches.
No patch will be released — the Terrascan project was archived by Tenable in August 2023. It is recommended to immediately cease using Terrascan in server mode (especially in network-accessible environments), migrate to an alternative tool, and — if continued use is unavoidable — restrict access to Terrascan endpoints using firewall or network-level access control mechanisms (e.g., localhost only or VPN).
Tenable Terrascan v1.18.3 and all earlier versions running in server mode (terrascan server)
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:XTenable Terrascan
APPTenable≤ 1.18.3
Related vulnerabilities
SSRF z możliwością odczytu plików lokalnych w Tenable Terrascan
Terrascan v1.18.3 and prior are vulnerable to Server-Side Request Forgery (SSRF) via the webhook_url parameter...
SSRF w mod_proxy Apache HTTP Server — przekierowanie żądań przez atakującego
SQL injection w REST API ticketingu — dostęp do danych bazy
Command Injection w endpoint Analysis REST — RCE przez parametry filtrów