In most cases, trust boundaries are violated when a secret is exposed in a source code repository or an uncontrolled deployment environment.
Unintended people who don’t need to know the secret might get access to it. They might then be able to use it to gain unwanted access to associated
services or resources.
The trust issue can be more or less severe depending on the people’s role and entitlement.
When an attacker gains access to a Docker Hub personal access token and the username of the account, they can gain access to all container images
accessible to that account.
What is the potential impact?
In case of a leaked token, an attacker can read out all private images and are also able to store new malicious images in the registry. This can
have multiple severe consequences.
Compromise of sensitive source code
Docker Hub is often used to store private container images. If a personal access token is leaked, it can be used by unauthorized individuals to
gain access to these images. Not only does this allow a malicious person to access and use internal projects, but it can also enable them to leak
sensitive source code, proprietary binaries, and other confidential resources belonging to these projects. This can lead to intellectual property
theft, unauthorized modifications, or even sabotage of your software.
If these private images contain other secrets, it might even lead to further breaches in the organization’s services.
Supply chain attacks
If the leaked secret gives an attacker the ability to publish code to private packages or repositories under the name of the organization, then
there may exist grave consequences beyond the compromise of source code. The attacker may inject malware, backdoors, or other harmful code into these
private repositories.
This can cause further security breaches inside the organization, but will also affect clients if the malicious code gets added to any products.
Distributing code that (unintentionally) contains backdoors or malware can lead to widespread security vulnerabilities, reputational damage, and
potential legal liabilities.