CVE Professor
/
All CVEs
CVE-2026-141356

CVE-2026-141356 — Chainguard Apko, Melange — CWE-522 · CWE-532

HIGH CVSS 8.2 Shodan

apko versions before 1.5.6 and melange versions before 0.66.1 can expose HTTP Basic Authentication credentials embedded in APK repository URLs. Affected builds can write usernames and passwords in cleartext to logs and error messages, including at the default log level. apko can also expose these credentials in package and index cache directory names and exported trace spans. Anyone with access to this output may obtain the credentials. The earlier fix for CVE-2024-36127 redacted repository URLs during YAML serialization, leaving these other exposure paths open.

apko versions before 1.5.6 and melange versions before 0.66.1 can expose HTTP Basic Authentication credentials embedded in APK repository URLs. Affected builds can write usernames and passwords in cleartext to logs and error messages, including at the default log level. apko can also expose these credentials in package and index cache directory names and exported trace spans. Anyone with access to this output may obtain the credentials. The earlier fix for CVE-2024-36127 redacted repository URLs during YAML serialization, leaving these other exposure paths open.

CVSS v4.0 Vector Metrics
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/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:X
Attack Vector Network AV:N
Attack Complexity Low AC:L
Attack Reqs. Present AT:P
Privileges Req. None PR:N
User Interaction None UI:N
Vuln. Conf. High VC:H
Vuln. Integrity None VI:N
Vuln. Avail. None VA:N
Subseq. Conf. None SC:N
Subseq. Integ. None SI:N
Subseq. Avail. None SA:N
Scope X S:X
AI Security Analysis & Remediation

🎯 What is this vulnerability?

This vulnerability is a Sensitive Information Exposure flaw (CWE-522) and Insertion of Sensitive Information into Log File (CWE-532) in the apko and melange build tools used by the Chainguard ecosystem.

The core technical failure is the lack of comprehensive credential sanitization across all output channels. While a previous fix (for CVE-2024-36127) addressed credential leakage during YAML serialization, it failed to sanitize credentials in:
1. Log Output: Usernames and passwords embedded in APK repository URLs (e.g., https://user:[email protected]/image) are written in cleartext to standard logs and error messages, even at default log levels.
2. Filesystem Artifacts: Credentials are exposed in the names of package and index cache directories.
3. Observability Data: Credentials are included in exported OpenTelemetry trace spans.

The CVSS vector AV:N/AC:L/AT:P/PR:N/UI:N/VC:H indicates that an attacker with network access and physical access to the build environment (or access to the artifacts produced by the build, such as logs, cache directories, or tracing backends) can obtain high-value credentials without requiring prior authentication or user interaction. The "Physical" attack vector here is interpreted in the context of CI/CD infrastructure as access to the build agent's filesystem, log aggregation systems, or monitoring dashboards.

⚡ Attack Chain

1. Discovery & Reconnaissance

An attacker targets a CI/CD pipeline or build environment that uses apko or melange to build container images.
  • Vector A (Log Aggregation): The attacker compromises the log aggregation system (e.g., ELK, Splunk, Datadog) or has read access to the build agent's local log files.
  • Vector B (Cache Directory): The attacker gains read access to the build agent's filesystem, specifically targeting the cache directories used by apko.
  • Vector C (Tracing Backend): The attacker has access to the OpenTelemetry collector or backend (e.g., Jaeger, Zipkin) where trace spans are exported.
  • 2. Exploitation

    The attacker searches for patterns indicating embedded credentials in URLs.

    Scenario A: Log File Analysis (Illustrative)
    The attacker greps the build logs for HTTP Basic Auth patterns.

    # Illustrative command to find exposed credentials in logs
    grep -E "https?://[^:]+:[^@]+@" /var/log/apko/build.log
    # Output example:
    # [INFO] Fetching image from https://admin:[email protected]/base-image:latest

    Scenario B: Cache Directory Enumeration (Illustrative)
    The attacker lists the cache directory where apko stores package indices. The directory names may contain the URL or parts of it.

    # Illustrative command to inspect cache directories
    ls -la /var/cache/apko/
    # Output example:
    # drwxr-xr-x 2 root root 4096 Dec  3 10:00 https://admin:[email protected]

    Scenario C: Trace Span Inspection (Illustrative)
    The attacker queries the tracing backend for spans containing sensitive attributes.

    # Illustrative query to Jaeger API
    curl -s "http://jaeger:16686/api/traces?service=apko" | jq '.data[] | select(.spans[].tags[] | .key == "url" and (.value | contains("://"))) | .spans[].tags[] | select(.key == "url") | .value'
    # Output example:
    # "https://admin:[email protected]/base-image:latest"

    3. Post-exploitation

    Once the credentials (username and password) for the internal container registry are extracted: 1. Registry Compromise: The attacker uses the stolen credentials to authenticate to the internal container registry (registry.internal.corp). 2. Image Tampering: The attacker can push malicious images to the registry, potentially overwriting legitimate base images or injecting backdoors into new builds. 3. Lateral Movement: If the registry credentials are reused across other services (e.g., artifact repositories, cloud provider APIs), the attacker can pivot to those systems. 4. Supply Chain Attack: By pushing a malicious base image, the attacker can compromise all downstream applications that use that base image, leading to widespread RCE in production environments.

    🌍 Real World Impact

  • Confidentiality (High): Direct exposure of credentials for internal container registries. This allows unauthorized access to proprietary software artifacts and potentially other systems if credentials are reused.
  • Integrity (None): The vulnerability itself does not directly allow modification of data, but the consequence* of credential theft (pushing malicious images) leads to severe integrity loss in the software supply chain.
  • Availability (None): No direct denial of service is caused by the exposure.
  • Practical Consequences:
  • * Supply Chain Compromise: Attackers can inject malicious code into container images, affecting all services built from those images. * Credential Reuse Attacks: If the same credentials are used for other services (e.g., cloud storage, CI/CD systems), the attacker can escalate privileges across the infrastructure. * Compliance Violations: Exposure of sensitive credentials may violate security policies and compliance standards (e.g., SOC2, ISO 27001).

    🛡️ Remediation & Mitigation

    Exact Affected Versions & Upgrade Recommendation

  • apko: Upgrade to version 1.5.6 or later.
  • melange: Upgrade to version 0.66.1 or later.
  • Action:

    # For apko
    go install github.com/chainguard-dev/apko/cmd/[email protected]
    
    # For melange
    go install github.com/chainguard-dev/melange/cmd/[email protected]

    Actionable Workarounds

    1. Avoid Embedding Credentials in URLs: * Use environment variables or secret managers (e.g., HashiCorp Vault, AWS Secrets Manager) to inject credentials at runtime, rather than hardcoding them in repository URLs. * Use .netrc files or registry configuration files that are securely managed and not logged.

    2. Restrict Access to Logs and Caches:
    * Ensure that log files and cache directories are accessible only to the build user and root.
    * Rotate and purge logs after build completion to minimize the window of exposure.

    3. Sanitize Tracing Data:
    * Configure OpenTelemetry exporters to filter out sensitive attributes (e.g., URLs with credentials) before exporting spans.
    * Use a custom processor to redact any string matching the pattern https?://[^:]+:[^@]+@.

    4. WAF/ModSecurity Rule (Illustrative):
    * While WAFs are not typically deployed on build agents, if logs are exposed via a web interface, a rule can be added to block access to log files containing credential patterns.

    # ModSecurity Rule to block access to log files with embedded credentials
        SecRule REQUEST_URI "@rx \.(log|txt)$" \
            "id:1001,phase:1,deny,status:403,msg:'Access to log files blocked'"

    Detection: IoCs

    1. Log Patterns: * Search for URLs with embedded credentials in build logs:
    https?://[^:]+:[^@]+@

    * Example: https://user:[email protected]

    2. Filesystem Artifacts:
    * Check for cache directories with names containing URL patterns:

    find /var/cache/apko -type d -name "*://*"

    3. Tracing Data:
    * Query tracing backends for spans containing URLs with credentials:

    SELECT * FROM traces WHERE attributes LIKE '%://%@%'

    ⚠️ Urgency

  • CVSS Score: 8.2 (HIGH)
  • CISA KEV: No
  • Exploit Complexity: Low (AC:L)
  • Patch Priority: High
Rationale: Although this vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, the high CVSS score and the critical nature of container registry credentials make this a high-priority issue. The ease of exploitation (low complexity) and the potential for supply chain attacks justify immediate patching. Organizations should prioritize upgrading apko and melange to the fixed versions and audit their build environments for any previously exposed credentials.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="Chainguard apko, melange"
CVSS Score
8.2 / 10 · CVSS HIGH
Weakness Types (CWE)
CWE-522 CWE-532
Affected Products (1)
Chainguard:apko, melange
References & Advisories (1)
Related CVEs
8.2
CVE-2026-144425
In melange versions 0.46.0 through 0.66.0, melange initramfs can log credentials embedded in APK repository an
8.3
CVE-2026-144677
Flagsmith 2.215.0 through 2.297.1 contains a credential exposure vulnerability that allows organisation member
7.4
CVE-2026-115978
Insertion of sensitive information into a log file in the push publishing receiver (for example POST /api/bund
7.4
CVE-2026-115979
Insertion of sensitive information into a log file in the push publishing receiver in dotCMS versions prior to
7.4
CVE-2026-115980
Three issues in dotCMS versions prior to 26.10.22-01, and 25.07.10 LTS prior to v23, were reported together. (
6.8
CVE-2026-144950
mcp-proxy from 0.10.0 before 0.13.3 contains an information exposure vulnerability that logs credentials and M
6.7
CVE-2026-139967
Insertion of Sensitive Information into Log File vulnerability in team-alembic ash_authentication allows a rea