In a recent investigation into Amazon Web Services (AWS) security breaches, Mandiant uncovered a troubling scenario: client-specific secrets were leaked from Atlassian’s code repository tool, Bitbucket, and exploited by threat actors to gain unauthorized access to AWS accounts.
This revelation highlights the potential vulnerabilities in Bitbucket’s Secured Variables.
These variables can be leaked in CI/CD pipelines, exposing organizations to significant security risks.
ANYRUN malware sandbox’s 8th Birthday Special Offer: Grab 6 Months of Free Service
Bitbucket, an Atlassian code hosting platform, includes a built-in continuous integration and delivery/deployment (CI/CD) service known as Bitbucket Pipelines.
This service is commonly used to deploy and maintain AWS resources.
According to Google Cloud Blog, Bitbucket’s administrative function, “Secured Variables,” allows administrators to store CI/CD secrets, such as AWS keys, directly in Bitbucket for easy reference by code libraries.
CI/CD secrets are crucial for authentication and authorization within CI/CD pipelines, providing the credentials for pipelines to interact with platforms like AWS.
These secrets are precious to attackers as they offer direct access to an environment.
Balancing the confidentiality of these secrets with ease of use for developers is a constant challenge in securing CI/CD pipelines.
CI/CD pipelines, like household plumbing, are complex orchestrations of events designed to accomplish specific tasks.
While they offer developers numerous possibilities for automating work, they can also be a source of anxiety for security professionals.
A single line of code with a hardcoded secret or a developer accidentally storing secrets locally can lead to significant security breaches.
Although Bitbucket’s secured variables are convenient for storing secrets locally, they have a concerning characteristic—they can be exposed in plain text through artifact objects.
If a Bitbucket variable, secured or not, is copied to an artifact object using the artifacts: command, the result is a .txt file with the variable’s value displayed in plain text.
To recreate the secret leak in a Bitbucket environment, follow these steps:
Once secrets are printed to the environment_variables.txt file, they can flow out of Bitbucket through the pipeline and become exposed.
This exposure can result from development mistakes, malicious intent, or accidental disclosure, leading to misuse by threat actors.
To protect your secrets when using Bitbucket Pipelines:
This case study is not an indictment against Bitbucket but a reminder of how seemingly innocuous actions can lead to serious security issues.
A single keystroke, line of code, or misconfiguration can cause a slow, untraceable leak of secrets through your pipeline, exposing them to the world.
Organizations must remain vigilant and implement robust security measures to safeguard their CI/CD environments.
Free Webinar on Live API Attack Simulation: Book Your Seat | Start protecting your APIs from hackers
The QSC Loader service DLL named "loader.dll" leverages two distinct methods to obtain the path…
Cybercriminals are exploiting the recent critical LDAP vulnerabilities (CVE-2024-49112 and CVE-2024-49113) by distributing fake proof-of-concept…
A NonEuclid sophisticated C# Remote Access Trojan (RAT) designed for the.NET Framework 4.8 has been…
Fraudsters in the Middle East are exploiting a vulnerability in the government services portal. By…
Juniper Networks has disclosed a significant vulnerability affecting its Junos OS and Junos OS Evolved…
CrowdStrike, a leader in cybersecurity, uncovered a sophisticated phishing campaign that leverages its recruitment branding…