See how chainguard compares to other vendors in security performance
Summary
The auth/aws package of the chainguard.dev/sdk Go library provides Chainguard's AWS-backed identity federation (an AWS workload proves its identity to Chainguard by signing an AWS STS GetCallerIdentity request). Its verifier, VerifyToken, reads the Chainguard-Audience and Chainguard-Identity binding headers from a presented token but does not require them to be covered by the SigV4 signature. AWS STS validates only the headers listed in SignedHeaders and ignores all others, so an attacker can take a GetCallerIdentity request that a victim signed for a different relying party, inject or rewrite those two headers after signing (without invalidating the signature), and replay it to any service that authenticates callers with VerifyToken. The binding those headers were meant to provide is therefore forgeable — a verifier-side (relying-party) authentication bypass / cross-service token replay.
Background
The package uses the standard "signed GetCallerIdentity" pattern — the same approach HashiCorp Vault's AWS auth method and Kubernetes aws-iam-authenticator use: the caller signs an AWS STS GetCallerIdentity request with its AWS credentials to prove who it is, and presents that signed request as a bearer token. It has two halves:
- GenerateToken (client): builds the GetCallerIdentity request, adds the Chainguard-Audience and Chainguard-Identity headers that bind the proof to a specific Chainguard audience (issuer) and assumable identity, SigV4-signs it, and serializes it into a token. - VerifyToken (relying party): decodes the token, checks those two binding headers, forwards the request to AWS STS to confirm the caller's real AWS identity (ARN), and returns it so a Chainguard token can be issued for that identity.
The binding headers exist so a proof minted for one audience/identity cannot be reused for another — a defense against cross-service replay — and their security depends entirely on being covered by the SigV4 signature.
Impact
A relying party calling auth/aws.VerifyToken can be induced to accept a GetCallerIdentity proof that a victim produced for an unrelated purpose — for example a request minted for HashiCorp Vault's AWS auth method, Kubernetes aws-iam-authenticator, a different audience, or one captured from logs or a proxy — and to treat it as proof of the victim's AWS identity for an attacker-chosen audience and identity. The signed request is valid within its ~15-minute window. No access to the victim's AWS credentials is required; the attacker only needs a fresh signed GetCallerIdentity request from the victim principal.
Code that uses only auth/aws.GenerateToken (token generation) is not affected — the generator correctly includes the binding headers in the signature. Only verifiers using auth/aws.VerifyToken are affected.
Affected versions
All released versions of chainguard.dev/sdk that include auth/aws.VerifyToken, up to and including v0.1.106.
Patches
Fixed in chainguard.dev/sdk v0.1.107. The fix requires both the Chainguard-Audience and Chainguard-Identity headers to be present in the request's SigV4 SignedHeaders before their values are trusted (mirroring the mitigation HashiCorp Vault applies by requiring X-Vault-AWS-IAM-Server-ID to be signed). It additionally adds defense-in-depth checks on the request method, the STS host, and the request timestamp. Upgrade to v0.1.107 or later.
Workarounds
There is no client-side workaround; the fix is in the verifier. Operators of services that verify AWS-backed identities with VerifyToken should upgrade as soon as the patched release is available.
References
- AWS Signature Version 4 — signed headers: https://docs.aws.amazon.com/IAM/latest/UserGuide/referencesigv.html - Comparable mitigation: HashiCorp Vault requires the X-Vault-AWS-IAM-Server-ID header to appear in SignedHeaders before trusting it.
Credits
Reported by Kris Kennaway (Datadog).
Summary
The auth/aws package of the chainguard.dev/sdk Go library provides Chainguard's AWS-backed identity federation (an AWS workload proves its identity to Chainguard by signing an AWS STS GetCallerIdentity request). Its verifier, VerifyToken, reads the Chainguard-Audience and Chainguard-Identity binding headers from a presented token but does not require them to be covered by the SigV4 signature. AWS STS validates only the headers listed in SignedHeaders and ignores all others, so an attacker can take a GetCallerIdentity request that a victim signed for a different relying party, inject or rewrite those two headers after signing (without invalidating the signature), and replay it to any service that authenticates callers with VerifyToken. The binding those headers were meant to provide is therefore forgeable — a verifier-side (relying-party) authentication bypass / cross-service token replay.
Background
The package uses the standard "signed GetCallerIdentity" pattern — the same approach HashiCorp Vault's AWS auth method and Kubernetes aws-iam-authenticator use: the caller signs an AWS STS GetCallerIdentity request with its AWS credentials to prove who it is, and presents that signed request as a bearer token. It has two halves:
- GenerateToken (client): builds the GetCallerIdentity request, adds the Chainguard-Audience and Chainguard-Identity headers that bind the proof to a specific Chainguard audience (issuer) and assumable identity, SigV4-signs it, and serializes it into a token. - VerifyToken (relying party): decodes the token, checks those two binding headers, forwards the request to AWS STS to confirm the caller's real AWS identity (ARN), and returns it so a Chainguard token can be issued for that identity.
The binding headers exist so a proof minted for one audience/identity cannot be reused for another — a defense against cross-service replay — and their security depends entirely on being covered by the SigV4 signature.
Impact
A relying party calling auth/aws.VerifyToken can be induced to accept a GetCallerIdentity proof that a victim produced for an unrelated purpose — for example a request minted for HashiCorp Vault's AWS auth method, Kubernetes aws-iam-authenticator, a different audience, or one captured from logs or a proxy — and to treat it as proof of the victim's AWS identity for an attacker-chosen audience and identity. The signed request is valid within its ~15-minute window. No access to the victim's AWS credentials is required; the attacker only needs a fresh signed GetCallerIdentity request from the victim principal.
Code that uses only auth/aws.GenerateToken (token generation) is not affected — the generator correctly includes the binding headers in the signature. Only verifiers using auth/aws.VerifyToken are affected.
Affected versions
All released versions of chainguard.dev/sdk that include auth/aws.VerifyToken, up to and including v0.1.106.
Patches
Fixed in chainguard.dev/sdk v0.1.107. The fix requires both the Chainguard-Audience and Chainguard-Identity headers to be present in the request's SigV4 SignedHeaders before their values are trusted (mirroring the mitigation HashiCorp Vault applies by requiring X-Vault-AWS-IAM-Server-ID to be signed). It additionally adds defense-in-depth checks on the request method, the STS host, and the request timestamp. Upgrade to v0.1.107 or later.
Workarounds
There is no client-side workaround; the fix is in the verifier. Operators of services that verify AWS-backed identities with VerifyToken should upgrade as soon as the patched release is available.
References
- AWS Signature Version 4 — signed headers: https://docs.aws.amazon.com/IAM/latest/UserGuide/referencesigv.html - Comparable mitigation: HashiCorp Vault requires the X-Vault-AWS-IAM-Server-ID header to appear in SignedHeaders before trusting it.
Credits
Reported by Kris Kennaway (Datadog).
apko allows users to build and publish OCI container images built from apk packages. Starting in version 0.27.0 and prior to version 0.29.5, critical files were inadvertently set to 0666, which could likely be abused for root escalation. Version 0.29.5 contains a fix for the issue.
wolfictl is a command line tool for working with Wolfi. A git authentication issue in versions prior to 0.16.10 allows a local user’s GitHub token to be sent to remote servers other than github.com. Most git-dependent functionality in wolfictl relies on its own git package, which contains centralized logic for implementing interactions with git repositories. Some of this functionality requires authentication in order to access private repositories. A central function GetGitAuth looks for a GitHub token in the environment variable GITHUBTOKEN and returns it as an HTTP basic auth object to be used with the github.com/go-git/go-git/v5 library. Most callers (direct or indirect) of GetGitAuth use the token to authenticate to github.com only; however, in some cases callers were passing this authentication without checking that the remote git repository was hosted on github.com. This behavior has existed in one form or another since commit 0d06e1578300327c212dda26a5ab31d09352b9d0 - committed January 25, 2023. This impacts anyone who ran the wolfictl check update commands with a Melange configuration that included a git-checkout directive step that referenced a git repository not hosted on github.com. This also impacts anyone who ran wolfictl update <url> with a remote URL outside of github.com. Additionally, these subcommands must have run with the GITHUBTOKEN environment variable set to a valid GitHub token. Users should upgrade to version 0.16.10 to receive a patch.
Malcontent could be made to expose Docker registry credentials if it scanned a specially crafted OCI image reference. Malcontent uses google/go-containerregistry for OCI image pulls, which by default uses the Docker credential keychain. A malicious registry could return a WWW-Authenticate header redirecting token authentication to an attacker-controlled endpoint, causing credentials to be sent to that endpoint.
Fix: Default to anonymous auth for OCI pulls
Acknowledgements
Thank you to Oleh Konko from 1seal for discovering and reporting this issue.
malcontent discovers supply-chain compromises through. context, differential analysis, and YARA. Starting in version 0.10.0 and prior to version 1.20.3, malcontent could be made to expose Docker registry credentials if it scanned a specially crafted OCI image reference. malcontent uses google/go-containerregistry for OCI image pulls, which by default uses the Docker credential keychain. A malicious registry could return a WWW-Authenticate header redirecting token authentication to an attacker-controlled endpoint, causing credentials to be sent to that endpoint. Version 1.20.3 fixes the issue by defaulting to anonymous auth for OCI pulls.
Use of the backend-facing $scheme variable in the trailing-slash directory redirect in nginx.conf of Chainguard Academy (edu) from commit 0b75ff98057f69b044a3e7194e428066ac5ad0d4 before commit 93dc0e50739c225f5aee2e803800a47fc0feb906 allows an on-path network attacker to read or modify documentation content served to a victim via an HTTPS request for a slashless directory path, because TLS terminates at the load balancer in front of Nginx and the resulting 301 response redirects the client to a plaintext http:// URL. Browsers that ship the HSTS preload list are not affected, because the .dev top-level domain is preloaded; clients that do not enforce HSTS, such as command-line HTTP clients and scripts that follow redirects, are affected.
apko allows users to build and publish OCI container images built from apk packages. From version 0.2.0 to before version 1.4.5, UserEntry.Parse and GroupEntry.Parse in pkg/passwd read the UID and GID fields of /etc/passwd and /etc/group entries with strconv.Atoi and convert them to uint32 without a range check. On 64-bit platforms an out-of-range value such as 4294967296 (2^32) is truncated to 0, and negative values wrap. Because apko parses the passwd and group entries supplied by the packages it installs and writes them back into the image, an attacker who controls a package installed into the image can ship an entry that appears to declare an unprivileged UID or GID but is written into the built image as UID 0 or GID 0 (root). The truncated UID is also used when resolving the image's run-as user. This issue has been fixed in version 1.4.5.
kaniko is a tool to build container images from a Dockerfile, inside a container or Kubernetes cluster. Starting in version 1.25.4 and prior to version 1.25.10, kaniko unpacks build context archives using filepath.Join(dest, cleanedName) without enforcing that the final path stays within dest. A tar entry like ../outside.txt escapes the extraction root and writes files outside the destination directory. In environments with registry authentication, this can be chained with docker credential helpers to achieve code execution within the executor process. Version 1.25.10 uses securejoin for path resolution in tar extraction.
melange update-cache downloads URIs from build configs via io.Copy without any size limit or HTTP client timeout (pkg/renovate/cache/cache.go). An attacker-controlled URI in a melange config can cause unbounded disk writes, exhausting disk on the build runner. Affected versions <= 0.40.5.
Fix: Merged Acknowledgements
melange thanks Oleh Konko from 1seal for discovering and reporting this issue.
Impact
melange lint --persist-lint-results (opt-in flag, also usable via melange build --persist-lint-results) constructs output file paths by joining --out-dir with the arch and pkgname values read from the .PKGINFO control file of the APK being linted. In affected versions these values were not validated for path separators or .. sequences, so an attacker who can supply an APK to a melange-based lint/build pipeline (e.g. CI that lints third-party APKs, or build-as-a-service) could cause melange to write lint-<pkgname>-<pkgver>-r<epoch>.json to an arbitrary .json path reachable by the melange process. The written file is a JSON lint report whose content is partially attacker-influenced. There is no direct code-execution path, but the write can clobber other JSON artifacts on the filesystem. The issue only affects deployments that explicitly pass --persist-lint-results; the flag is off by default.
Patches
Fixed in melange v0.43.4 by validating arch and pkgname for .., /, and filepath.Separator before path construction in pkg/linter/results.go (commit 84f3b45).
Workarounds
Do not pass --persist-lint-results when linting or building APKs whose .PKGINFO contents are not fully trusted. Running melange as a low-privileged user and confining writes to an isolated directory also limits impact.
Credits
melange thanks Oleh Konko (@1seal from 1seal.org) for discovering and reporting this issue.
Impact
An attacker who can influence a melange configuration file — for example through pull-request-driven CI or build-as-a-service scenarios — could set pipeline[].uses to a value containing ../ sequences or an absolute path. The (Compiled).compilePipeline function in pkg/build/compile.go passed uses directly to filepath.Join(pipelineDir, uses + ".yaml") without validating the value, so the resolved path could escape each --pipeline-dir and read an arbitrary YAML-parseable file visible to the melange process. Because the loaded file is subsequently interpreted as a melange pipeline and its runs: block is executed via /bin/sh -c in the build sandbox, this additionally allowed shell commands sourced from an out-of-tree file to run during the build, bypassing the review boundary that normally covers the in-tree pipeline definition.
Patches
Fixed in melange v0.43.4 via commit 5829ca4. The fix rejects uses values that are absolute paths or contain .., and verifies (via filepath.Rel after filepath.Clean) that the resolved target remains within the pipeline directory.
Workarounds
Only run melange build against configuration files from trusted sources. In CI systems that build user-supplied melange configs, gate builds behind manual review of pipeline[].uses values and reject any containing .. or leading /.
Credits
melange thanks Oleh Konko (@1seal from 1seal.org) for discovering and reporting this issue.
malcontent is software for discovering supply-chain compromises through context, differential analysis, and YARA. Prior to version 1.21.0, malcontent would remove nested archives which failed to extract which could potentially leave malicious content. A better approach is to preserve these archives so that malcontent can attempt a best-effort scan of the archive bytes. Version 1.21.0 fixes the issue.
malcontent could be made to create symlinks outside the intended extraction directory when scanning a specially crafted tar or deb archive. The handleSymlink function received arguments in the wrong order, causing the symlink target to be used as the symlink location. Additionally, symlink targets were not validated to ensure they resolved within the extraction directory.
Fixes: - Swap handleSymlink arguments; validate symlink location - Validate symlink targets resolve within extraction directory
Acknowledgements
Thank you to Oleh Konko from 1seal for discovering and reporting this issue.
An attacker who controls or compromises an APK repository used by apko could cause resource exhaustion on the build host. The ExpandApk function in pkg/apk/expandapk/expandapk.go expands .apk streams without enforcing decompression limits, allowing a malicious repository to serve a small, highly-compressed .apk that inflates into a large tar stream, consuming excessive disk space and CPU time, causing build failures or denial of service. Fix: Fixed in 2be3903. Released in 1.1.0. Acknowledgements apko thanks Oleh Konko (@1seal) from 1seal for discovering and reporting this issue.
expandapk.Split drains the first gzip stream of an APK archive via io.Copy(io.Discard, gzi) without explicit bounds. With an attacker-controlled input stream, this can force large gzip inflation work and lead to resource exhaustion (availability impact). The Split function reads the first tar header, then drains the remainder of the gzip stream by reading from the gzip reader directly without any maximum uncompressed byte limit or inflate-ratio cap. A caller that parses attacker-controlled APK streams may be forced to spend excessive CPU time inflating gzip data, leading to timeouts or process slowdown. Fix: Fixed with 2be3903, Released in v1.1.0. Acknowledgements apko thanks Oleh Konko from 1seal for discovering and reporting this issue.
A Path Traversal vulnerability was discovered in apko's dirFS filesystem abstraction. An attacker who can supply a malicious APK package (e.g., via a compromised or typosquatted repository) could create directories or symlinks outside the intended installation root. The MkdirAll, Mkdir, and Symlink methods in pkg/apk/fs/rwosfs.go use filepath.Join() without validating that the resulting path stays within the base directory.
Fix: Fixed by d8b7887. Merged into release.
Acknowledgements apko thanks Oleh Konko from 1seal for discovering and reporting this issue.
An attacker who can influence the tar stream from a QEMU guest VM could write files outside the intended workspace directory on the host. The retrieveWorkspace function extracts tar entries without validating that paths stay within the workspace, allowing Path Traversal via ../ sequences.
Fix: Fixed in 6e243d0d. Merged in release.
Acknowledgements
melange thanks Oleh Konko from 1seal for discovering and reporting this issue.
An attacker who can provide build input values, but not modify pipeline definitions, could execute arbitrary shell commands if the pipeline uses ${{vars.}} or ${{inputs.}} substitutions in working-directory. The field is embedded into shell scripts without proper quote escaping.
Fix: Fixed with e51ca30c, Released.
Acknowledgements
melange thanks Oleh Konko from 1seal for discovering and reporting this issue.
An attacker who can influence inputs to the patch pipeline could execute arbitrary shell commands on the build host. The patch pipeline in pkg/build/pipelines/patch.yaml embeds input-derived values (series paths, patch filenames, and numeric parameters) into shell scripts without proper quoting or validation, allowing shell metacharacters to break out of their intended context. The vulnerability affects the built-in patch pipeline which can be invoked through melange build and melange license-check operations. An attacker who can control patch-related inputs (e.g., through pull request-driven CI, build-as-a-service, or by influencing melange configurations) can inject shell metacharacters such as backticks, command substitutions $(…), semicolons, pipes, or redirections to execute arbitrary commands with the privileges of the melange build process.
Fix: Fixed in bd132535 , Released in 0.40.3. Acknowledgements melange thanks Oleh Konko (@1seal) from 1seal for discovering and reporting this issue.
An attacker who can influence a melange configuration file (e.g., through pull request-driven CI or build-as-a-service scenarios) could read arbitrary files from the host system. The LicensingInfos function in pkg/config/config.go reads license files specified in copyright[].license-path without validating that paths remain within the workspace directory, allowing path traversal via ../ sequences. The contents of the traversed file are embedded into the generated SBOM as license text, enabling exfiltration of sensitive data through build artifacts. Fix: Merged in commit 2f95c9f4 Acknowledgements melange thanks Oleh Konko (@1seal) from 1seal for discovering and reporting this issue.