Exposure of Private RSA Private Key in curl GitHub Repository
A private RSA key and certificate were committed to the public curl GitHub repository in a test data file. An attacker could use the key to impersonate a server or decrypt traffic if it were used in any environment.
- Disclosed after under an hour
Description: I discovered that a private RSA key along with its certificate is publicly accessible inside the curl GitHub repository under the file tests/data/stunnel.pem. This file contains a PEM-formatted RSA private key, which should be kept strictly confidential.
Steps to Reproduce:
Navigate to the following URL in the curl GitHub repo: https://github.com/curl/curl/blob/cc872ebc192f64aa6360853fbdbf0476d05b9178/tests/data/stunnel.pem
View the contents of the file, which contain a private RSA key and certificate.
Suggested Mitigations:
Remove the private key and certificate files from the public repository immediately.
If these keys are used in any environment, revoke and replace them with newly generated keys.
Use environment variables or secure vaults to store sensitive keys instead of including them in source code repositories.
Additional Notes:
The key appears to be 1024-bit RSA with an outdated signature algorithm (md5WithRSAEncryption).
The certificate validity expired long ago, indicating this might be a test key, but its public exposure is still a security risk.
Consider adding scanning tools or git pre-commit hooks to prevent committing private keys in the future.
If you want, I can help you tailor this report for submission or convert it into a specific bug bounty platform format.
Impact
Impact:
Disclosure of private keys compromises the security of encrypted communications.
If these keys are used anywhere in production or test environments, an attacker can fully compromise secure channels or authenticate maliciously.
Exposure of private keys in a public repository is a critical security risk, as it could allow attackers to:
Impersonate the server or service using this key
Decrypt sensitive communication if the key is used in production or testing environments
Conduct man-in-the-middle (MITM) attacks
Attachments

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 a test key was committed to the source repository without checking that it was a private key.
Impact
If the key were used in any environment, an attacker could impersonate the server, decrypt traffic, or conduct man-in-the-middle attacks; the text notes the certificate expired long ago and may be a test key.
What the attacker needed
None
The fix
The key and certificate should be removed from the repository, and any key used elsewhere should be revoked and replaced.
How it was found
- Open the file in the curl GitHub repository.
- View the contents, which include a private RSA key and certificate.
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 and decrypts its traffic. This one was left in a public code repository, so anyone could copy it. If that key were used for a real service, someone else could pretend to be that service or read its encrypted messages.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.