Skip to content
Leaked secrets Disclosed report Beginner

Exposure of Hard-coded Private Keys and Credentials in curl Source Repository (CWE-321)

The curl source repository contains hard-coded private keys and example credentials in test and documentation files. An attacker could use these secrets to impersonate curl infrastructure, decrypt traffic, or pivot into build systems if the keys are reused.

spectre-1 Follow

Originally disclosed on HackerOne

Critical View original
  • Disclosed after under an hour

Multiple private/test RSA keys and example credentials were discovered embedded in the public curl source repository and associated documentation. These sensitive secrets were detected using automated tools (gitleaks) and manual review. Their presence could allow attackers to impersonate trusted curl infrastructure, decrypt traffic, or pivot into build or CI systems if reused, creating a severe supply chain risk. Such exposures also risk compliance violations (e.g., GDPR, PCI-DSS, HIPAA) and undermine trust in open source releases.

This report, including the verification steps and analysis, was prepared using an AI security assistant to ensure comprehensive and reproducible results. Affected version

Confirmed in curl master branch as of August 2025. Also observed in prior tags (≥ 7.80.0) on Linux and macOS. Example version for testing:

curl 8.1.2 (x86_64-pc-linux-gnu) libcurl/8.1.2 OpenSSL/3.0.7 zlib/1.2.13 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.4 nghttp2/1.51.0 Release-Date: 2023-06-12 Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp ws wss Platform: Linux 5.15.0-83-generic x86_64

Steps To Reproduce:

Clone the curl repository: git clone https://github.com/curl/curl.git
Run a secret scanning tool (e.g., gitleaks detect --source=.) to identify hard-coded secrets.
Alternatively, search for likely private key and credential strings with:
    grep -r '-----BEGIN' ./tests/
    grep -r 'password' ./docs/examples/
Review identified files to confirm the presence of full private keys or functional credential examples, such as tests/data/testprivkey.pem or docs/examples/http-auth-example.txt.
See .gitleaks/report.json for a consolidated findings report.

Supporting Material/References:

Example evidence: tests/data/testprivkey.pem containing full private key
Example evidence: docs/examples/http-auth-example.txt with plaintext credentials
Full scan log: .gitleaks/report.json (generated via gitleaks)
curl/curl GitHub repository
Screenshot evidence as required (available on request)

Severity: Critical / CWE-321 (Use of Hard-coded Cryptographic Key)

Impact

Summary:The security impact of this vulnerability is severe and multi-faceted:

Impersonation & Privilege Escalation: Attackers can use leaked private keys to impersonate curl services, developers, or automated systems, gaining unauthorized access to protected infrastructure or code-signing processes.
Data Decryption: If any of the exposed keys have been (or are) used in production, an attacker could decrypt sensitive traffic or files, leading to data breaches.
Credential Stuffing & Service Hijack: Exposed example/test credentials may be reused in production or CI/CD, allowing attackers to pivot and escalate their access within targeted environments.
Supply Chain Attacks: Malicious actors might leverage sensitive secrets to inject or distribute malicious builds of curl/libcurl or to poison official releases.
Regulatory & Compliance Risks: This level of exposure may trigger mandatory breach reporting and legal or regulatory actions, especially for downstream consumers subject to compliance standards.

In summary: This issue enables attackers to compromise trust in the curl project, attack users and downstream integrations at scale, and potentially introduce persistent, hard-to-detect threats into the open source supply chain and the global software ecosystem.

The original report as published on HackerOne, by spectre-1. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, test and example files containing private keys and credentials were committed to the public repository without being replaced by placeholders or removed.

Impact

If the exposed keys or credentials are reused in production or CI systems, an attacker could impersonate services, decrypt traffic, or inject malicious builds, though the report does not confirm such reuse.

What the attacker needed

Public access to the curl repository

How it was found

  1. Clone the curl repository.
  2. Run a secret scanning tool such as gitleaks.
  3. Search for private key and credential strings in tests and docs.
  4. Review identified files to confirm full private keys or functional 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 report has not been written yet. The Original tab links to the source.

A private key is like a secret password that proves a server's identity. If it is published, anyone can pretend to be that server. This report says some test keys and example passwords were left in the curl project's public code, which could be dangerous if those same keys are used in real systems.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More by spectre-1

View all

2 more disclosed reports, best first.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.