Skip to content
Info disclosure Disclosed report Intermediate

AWS SigV4 Signature Disclosure via Verbose Logging in libcurl

When libcurl is built with AWS SigV4 support and verbose logging is enabled, it prints the string-to-sign and the final HMAC signature to the log. Anyone with read access to those logs could replay authenticated AWS API calls within the signature validity window.

leftyha Follow

Originally disclosed on HackerOne

  • Disclosed after 38 hours

Summary

When libcurl is built with AWS SigV4 support, enabling verbose logging (CURLOPT_VERBOSE or --verbose) causes the library to print both the string-to-sign and the final HMAC signature into logs.

Because signatures remain valid for several minutes and are derived directly from AWS credentials, this behavior leaks sensitive material into log files or consoles. Any operator, log aggregation system, or low-privileged account with read access to those logs can replay authenticated AWS API calls or recover details of signed requests.

This is a credential leakage vulnerability in libcurl’s http_aws_sigv4.c.


Affected Component

  • File: lib/http_aws_sigv4.c
  • Function: aws_sigv4_add(), which calls infof() with the string-to-sign and the computed signature.
  • Affects: latest libcurl (tested on 8.x) with AWS SigV4 signing enabled.

Steps to Reproduce

    1. Setup
  • Build libcurl with AWS SigV4 enabled (default since 7.75.0).
  • Export valid AWS credentials (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY).
  • Enable verbose mode (--verbose or CURLOPT_VERBOSE).
    1. Run a Signed Request

Run a simple signed AWS request, e.g. list S3 buckets:

Bash
AWS_ACCESS_KEY_ID=AWS_ACCESS_KEY... \
AWS_SECRET_ACCESS_KEY=SECRET... \
curl --aws-sigv4 "aws:amz:us-east-1:s3" \
     --verbose \
     https://s3.amazonaws.com/
    1. Observe Logs

In the console (or redirected logs), libcurl prints sensitive information:

* string-to-sign: AWS4-HMAC-SHA256 20250929T124500Z ...
* signature: 7a5d1c84e2c3d8f9...
    1. Replay the Request

An attacker with access to these logs can immediately replay the request for several minutes:

Bash
curl -H "Authorization: AWS4-HMAC-SHA256 Credential=..., SignedHeaders=..., Signature=7a5d1c84e2c3d8f9..." \
     https://s3.amazonaws.com/

The replay succeeds as long as the signature is within the validity window (typically 5 minutes).


Impact

  • Confidentiality: AWS API credentials/signatures are leaked into logs.
  • Integrity: Attackers can replay AWS API calls (e.g., list buckets, upload/download objects).
  • Availability: Replay could be abused to flood services with valid signed requests.
  • Realistic scenario: Any team using --verbose for troubleshooting, or logging libcurl output to central log collectors, unintentionally leaks AWS secrets to less-trusted operators.

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

libcurl is the library behind the curl command line tool and a very large number of applications that make HTTP requests. One of its optional features is request signing for AWS: when built with AWS SigV4 support, libcurl can take AWS credentials and produce the Authorization header for a request itself, so the caller does not have to implement the signing algorithm.

The signing code lives in lib/http_aws_sigv4.c. The function aws_sigv4_add() builds the string-to-sign and computes the HMAC signature, then calls infof() with both values. infof() is the library's informational logging function, so anything passed to it is printed whenever verbose logging is enabled, either through CURLOPT_VERBOSE in code or --verbose on the command line.

The report describes the result as a credential leakage vulnerability: the material that ends up in the log is enough to authenticate requests to AWS for a short window.

Setup

The preconditions are modest and are all things a normal user of the feature would have:

  1. A libcurl build with AWS SigV4 support. The report notes this is enabled by default since 7.75.0, and that testing was done on 8.x.
  2. Valid AWS credentials exported as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
  3. Verbose mode turned on, via --verbose or CURLOPT_VERBOSE.

No special role, account or tooling is needed. The vulnerable behaviour appears in the ordinary debugging workflow of anyone signing AWS requests with libcurl.

Finding it

The researcher looked at what libcurl writes to its verbose output when it signs a request. Because aws_sigv4_add() passes the string-to-sign and the computed signature to infof(), both appear in the log. Both values are sensitive, and the signature is derived directly from the AWS credentials.

The signature is not a long-lived secret in the way an access key is, but it is valid for several minutes, which is long enough to matter. That combination, sensitive material written to a place that is routinely collected and shared, is what made the behaviour look wrong.

Exploitation

Step 1: build and configure

Build libcurl with AWS SigV4 enabled (default since 7.75.0), export valid AWS credentials, and enable verbose mode with --verbose or CURLOPT_VERBOSE.

Step 2: run a signed request

The researcher used a simple signed AWS request, listing S3 buckets:

Bash
AWS_ACCESS_KEY_ID=AWS_ACCESS_KEY... \
AWS_SECRET_ACCESS_KEY=SECRET... \
curl --aws-sigv4 "aws:amz:us-east-1:s3" \
     --verbose \
     https://s3.amazonaws.com/

, and --verbose turns on the logging that carries the leak.

Step 3: read the logs

In the console, or in whatever file the output was redirected to, libcurl prints the sensitive values:

* string-to-sign: AWS4-HMAC-SHA256 20250929T124500Z ...
* signature: 7a5d1c84e2c3d8f9...

Together they describe a complete, valid signed request.

Step 4: replay

Anyone who can read those logs can rebuild the request and send it again:

Bash
curl -H "Authorization: AWS4-HMAC-SHA256 Credential=..., SignedHeaders=..., [redacted]" \
     https://s3.amazonaws.com/

The replay succeeds as long as the signature is inside its validity window, which the report puts at typically 5 minutes. The attacker does not need the secret key: the signature already proves possession of it for that request.

Root cause

The mistake is in lib/http_aws_sigv4.c: aws_sigv4_add() calls infof() with the string-to-sign and the computed signature. infof() output is controlled by the verbose flag, so the values are emitted whenever a user debugs a request, which is exactly when logs are most likely to be captured and shared.

The signing function passes both values to infof(), so they reach the verbose log without any redaction. The signature's short lifetime limits the window but does not remove the exposure, because the whole point of a signature is that it authenticates a request without the secret key being present.

Impact

The report frames the impact across the usual three areas:

  • Confidentiality: AWS API credentials and signatures are leaked into logs.
  • Integrity: an attacker can replay AWS API calls, for example listing buckets or uploading and downloading objects.
  • Availability: replay could be abused to flood services with valid signed requests.

The realistic scenario is broad: any team that uses --verbose for troubleshooting, or that ships libcurl output to central log collectors, leaks AWS material to less-trusted operators. The exposure is bounded by the signature validity window, typically 5 minutes.

Fix

The report identifies the offending call in aws_sigv4_add() but does not describe a patch or a change that was made. The fix that follows from the finding is to stop passing the string-to-sign and the signature to infof(), or to redact them before they reach the log, so that verbose output no longer contains material that can authenticate a request.

Variants to test

  • Other signing helpers in the same library or in wrappers. Look for any code path that logs derived authentication material (signatures, tokens, canonical requests) at verbose or debug level. A positive result is a log line containing a value that can be replayed or that reveals credential-derived material.
  • Applications that embed libcurl. Check whether the application enables CURLOPT_VERBOSE in production or forwards libcurl debug output to its own logging. A positive result is signature material appearing in application logs rather than only on a developer's console.
  • Log pipelines. Trace where verbose output goes: files, stdout captured by a supervisor, central collectors. A positive result is the signature reaching a system with broader read access than the credentials themselves.
  • Replay window. For any leaked signature, test whether it is still accepted after capture. A positive result is a successful authenticated response within the validity window.

Hunting notes

This class of bug hides in diagnostic code: the logging calls inside signing, authentication and token-handling routines, and the places where a library's debug output is wired into an application's logging framework. The signal during recon is a target that signs requests itself, or wraps a library that does, combined with any documented or observable verbose/debug mode. The report shows how the leaked values from the log can be used to replay a signed AWS request, turning a log line into an authenticated action.

Difficulty: beginner. The behaviour is visible in ordinary verbose output and the reproduction needs only credentials, a signed request and a replay within the validity window.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

Imagine you have a key to your house, and every time you unlock the door, a small printer next to the lock spits out a receipt. The receipt does not contain the key itself, but it contains a one-time code that the door will accept for the next few minutes. Anyone who picks up that receipt can walk up to your door and open it, without ever holding your key. That is roughly what this report is about, but for cloud accounts instead of houses.

libcurl is a piece of software that many programs use to talk to web servers. It is also the engine behind the curl command line tool, which people type into a terminal to fetch web pages or call web services. One of libcurl's optional features is signing requests for Amazon Web Services (AWS). When you use that feature, libcurl takes your AWS credentials and produces a special header called Authorization that proves to AWS that the request really came from you. The caller does not have to work out the signing maths themselves.

The problem is that when you turn on libcurl's chatty debugging mode, called verbose logging, the signing code prints two things into the log: the "string-to-sign" and the final "signature". Both are derived directly from your AWS credentials. The signature stays valid for several minutes. So anyone who can read that log, whether an operator, a log collection system, or a low-privileged account with read access to the log files, can copy the signature and send the same request again. AWS will accept it. The report calls this a credential leakage vulnerability, and it lives in a file called lib/http_aws_sigv4.c.

The pieces involved

Before the steps, here are the terms you will meet, explained from scratch.

  • API: an API (Application Programming Interface) is the set of addresses and rules a service offers so that programs, rather than people clicking in a browser, can ask it to do things. Think of a restaurant menu: you do not walk into the kitchen, you order from the menu and the kitchen sends back a dish. AWS's API lets a program list storage buckets, upload files and so on.
  • AWS: Amazon Web Services, Amazon's cloud platform. Among other things it offers S3, a service for storing files in containers called buckets.
  • Credentials: the pair of values that identify you to AWS. In this report they are an access key ID and a secret access key. The access key ID is like a username; the secret access key is like a password and must never be shared.
  • Request signing: instead of sending your secret key with every request (which would be reckless), AWS asks you to compute a signature, a short code derived from the request and your secret key. You attach the signature to the request. AWS recomputes it on its side and checks it matches. The secret key itself never travels over the network.
  • HMAC: a standard way of computing such a signature using a secret key and a message. The same inputs always give the same output, and without the key you cannot produce a valid one.
  • String-to-sign: the exact text that gets fed into the HMAC. It contains details of the request, including a timestamp.
  • SigV4: the name of AWS's signing scheme, short for Signature Version 4. It is the recipe that says how to build the string-to-sign and turn it into a signature.
  • Header: extra labelled information attached to a web request, such as Authorization, which carries the signature.
  • Verbose logging: a debugging mode where a program prints lots of detail about what it is doing. Useful when something goes wrong, but it often prints more than you would want a stranger to see.
  • Replay: taking a captured request and sending it again, unchanged. If the service still accepts it, the replay succeeds.
  • Credential leakage: a vulnerability class where secret material ends up somewhere it should not be, such as a log file, a screenshot or an error message.

The affected component

The report points at one file and one function:

  • File: lib/http_aws_sigv4.c
  • Function: aws_sigv4_add(), which calls infof() with the string-to-sign and the computed signature.
  • Affects: the latest libcurl (tested on 8.x) with AWS SigV4 signing enabled.

infof() is libcurl's own informational logging function. Anything handed to it is printed whenever verbose logging is on, either through the CURLOPT_VERBOSE setting in code or the --verbose flag on the command line. So the signing function is effectively writing secrets into the debug output.

Setup

The preconditions are modest, and they are all things a normal user of the feature would already have:

  1. A libcurl build with AWS SigV4 support. The report notes this is enabled by default since version 7.75.0, and that testing was done on 8.x.
  2. Valid AWS credentials exported as the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
  3. Verbose mode turned on, via --verbose or CURLOPT_VERBOSE.

No special role, account or tooling is needed. The behaviour appears in the ordinary debugging workflow of anyone signing AWS requests with libcurl.

Finding it

The researcher looked at what libcurl writes to its verbose output when it signs a request. Because aws_sigv4_add() passes the string-to-sign and the computed signature to infof(), both appear in the log. Both values are sensitive, and the signature is derived directly from the AWS credentials.

The signature is not a long-lived secret in the way an access key is, but it is valid for several minutes, which is long enough to matter. That combination, sensitive material written to a place that is routinely collected and shared, is what made the behaviour look wrong.

Exploitation

Step 1: build and configure

Build libcurl with AWS SigV4 enabled (default since 7.75.0), export valid AWS credentials, and enable verbose mode with --verbose or CURLOPT_VERBOSE.

This step is just preparation. You need a copy of libcurl that knows how to sign AWS requests, you need to tell it who you are by putting your credentials into environment variables, and you need to switch on the chatty logging so you can see what it does. Without the credentials there is nothing to sign with; without verbose mode the leak stays hidden.

Step 2: run a signed request

The researcher used a simple signed AWS request, listing S3 buckets:

Bash
AWS_ACCESS_KEY_ID=AWS_ACCESS_KEY... \
AWS_SECRET_ACCESS_KEY=SECRET... \
curl --aws-sigv4 "aws:amz:us-east-1:s3" \
     --verbose \
     https://s3.amazonaws.com/

Line by line:

  • AWS_ACCESS_KEY_ID=AWS_ACCESS_KEY... sets the environment variable holding your access key ID for this one command. The value shown is a placeholder, not a real key.
  • AWS_SECRET_ACCESS_KEY=SECRET... does the same for the secret access key. Again, a placeholder.
  • curl --aws-sigv4 "aws:amz:us-east-1:s3" runs curl and tells it to sign the request using AWS SigV4.
  • --verbose turns on the detailed logging. This is the flag that causes the leak.
  • https://s3.amazonaws.com/ is the address being requested.

The backslashes at the end of lines simply tell the shell that the command continues on the next line.

Step 3: read the logs

In the console, or in whatever file the output was redirected to, libcurl prints the sensitive values:

Text
* string-to-sign: AWS4-HMAC-SHA256 20250929T124500Z ...
* signature: 7a5d1c84e2c3d8f9...

Line by line:

  • The first line shows the string-to-sign. AWS4-HMAC-SHA256 names the algorithm. 20250929T124500Z is a timestamp. The ... stands for the rest of the request details that the report does not reproduce.
  • The second line shows the final signature, the HMAC value computed from that string. The ... again stands for the remainder of the value.

Together these describe a complete, valid signed request.

Step 4: replay

Anyone who can read those logs can rebuild the request and send it again:

Bash
curl -H "Authorization: AWS4-HMAC-SHA256 Credential=..., SignedHeaders=..., [redacted]" \
     https://s3.amazonaws.com/

Line by line:

  • curl -H "Authorization: ..." sends a request with an extra header attached. -H means "add this header".
  • Inside the header, AWS4-HMAC-SHA256 names the signing scheme, , and [redacted] is the captured signature. The ...` marks values the report leaves out.
  • https://s3.amazonaws.com/ is the same address as before.

The replay succeeds as long as the signature is inside its validity window, which the report puts at typically 5 minutes. The attacker does not need the secret key: the signature already proves possession of it for that request.

Root cause

The mistake is in lib/http_aws_sigv4.c: aws_sigv4_add() calls infof() with the string-to-sign and the computed signature. infof() output is controlled by the verbose flag, so the values are emitted whenever a user debugs a request, which is exactly when logs are most likely to be captured and shared.

The signing function passes both values to infof(), so they reach the verbose log without any redaction. The signature's short lifetime limits the window but does not remove the exposure, because the whole point of a signature is that it authenticates a request without the secret key being present.

Impact

The report frames the impact across the usual three areas:

  • Confidentiality: AWS API credentials and signatures are leaked into logs.
  • Integrity: an attacker can replay AWS API calls, for example listing buckets or uploading and downloading objects.
  • Availability: replay could be abused to flood services with valid signed requests.

The realistic scenario is broad: any team that uses --verbose for troubleshooting, or that ships libcurl output to central log collectors, leaks AWS material to less-trusted operators. The exposure is bounded by the signature validity window, typically 5 minutes.

Fix

The report identifies the offending call in aws_sigv4_add() but does not describe a patch or a change that was made. The fix that follows from the finding is to stop passing the string-to-sign and the signature to infof(), or to redact them before they reach the log, so that verbose output no longer contains material that can authenticate a request.

Variants to test

  • Other signing helpers in the same library or in wrappers. Look for any code path that logs derived authentication material (signatures, tokens, canonical requests) at verbose or debug level. A positive result is a log line containing a value that can be replayed or that reveals credential-derived material.
  • Applications that embed libcurl. Check whether the application enables CURLOPT_VERBOSE in production or forwards libcurl debug output to its own logging. A positive result is signature material appearing in application logs rather than only on a developer's console.
  • Log pipelines. Trace where verbose output goes: files, stdout captured by a supervisor, central collectors. A positive result is the signature reaching a system with broader read access than the credentials themselves.
  • Replay window. For any leaked signature, test whether it is still accepted after capture. A positive result is a successful authenticated response within the validity window.

Hunting notes

This class of bug hides in diagnostic code: the logging calls inside signing, authentication and token-handling routines, and the places where a library's debug output is wired into an application's logging framework. The signal during recon is a target that signs requests itself, or wraps a library that does, combined with any documented or observable verbose or debug mode. The report shows how the leaked values from the log can be used to replay a signed AWS request, turning a log line into an authenticated action.

Difficulty: beginner. The behaviour is visible in ordinary verbose output and the reproduction needs only credentials, a signed request and a replay within the validity window.

Glossary

  • API: the set of addresses and rules a service offers so that programs can ask it to do things, rather than a person clicking in a browser.
  • AWS SigV4: AWS's Signature Version 4 scheme, the recipe for signing requests to AWS.
  • Bucket: a container for files in Amazon's S3 storage service.
  • Credential leakage: a vulnerability class where secret material ends up somewhere it should not be, such as a log file.
  • Credentials: the values that identify you to a service, here an access key ID and a secret access key.
  • curl: a command line tool for making web requests, built on libcurl.
  • Environment variable: a named value set in the shell that programs can read, such as AWS_ACCESS_KEY_ID.
  • Header: extra labelled information attached to a web request, such as Authorization.
  • HMAC: a standard way of computing a signature from a secret key and a message.
  • libcurl: the software library behind curl and many other programs that make web requests.
  • Replay: sending a captured request again, unchanged, and having the service accept it.
  • S3: Amazon's file storage service.
  • Signature: a short code derived from a request and a secret key, proving the request came from the key holder.
  • String-to-sign: the exact text fed into the HMAC to produce a signature.
  • Vulnerability: a weakness in software that lets someone do something they should not be able to do.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.