LeakyCLI: AWS and Google Cloud Command-Line Tools Can Expose Sensitive Credentials in Build Logs
The AWS and Google Cloud command-line tools print environment variables of serverless functions to standard output during certain commands, which can leak sensitive credentials into build logs. An attacker who can read those logs could obtain passwords, keys, and other secrets to access cloud resources.
Published on orca.security
In November last year, Microsoft fixed a severe security issue in Azure CLI that risked exposing credentials in logs. The vulnerability was identified as CVE-2023-36052 and given a CVSS score of 8.6.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the command-line tools return the full configuration of serverless functions, including environment variables, as part of their normal output for commands that update or delete functions, without filtering out sensitive values.
Impact
Attackers who can read build logs could obtain credentials and access any resources that the repository owners can, though the vendors consider this expected behaviour and have provided mitigations.
What the attacker needed
Publicly accessible build logs; Use of vulnerable CLI commands in CI/CD; Secrets stored in environment variables
The fix
The vendors recommend not storing secrets in environment variables, retrieving them from a dedicated secrets manager, and suppressing command output by piping to /dev/null or using flags like --no-user-output-enabled.
How it was found
- Search public code repositories for workflow files that use the vulnerable AWS or Gcloud commands.
- Open the build logs of the found repositories.
- Look for environment variables printed in the logs, which may contain credentials.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When developers use cloud command-line tools in automated build systems, the tools sometimes print out all the settings of a function, including secret values like passwords. If those printed values end up in build logs that others can read, attackers can steal the secrets and use them to access the cloud account. This report shows that this happens with AWS and Google Cloud tools, and that many public code repositories have such leaks.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.