# API request signature can be reused with other parameters/data than the original in certain cases

Gatecoin API signatures excluded the request payload and were cached only 300s, letting an attacker replay a captured signature with a different body to mint a full-privilege API key.

- Payout: hidden
- Severity: medium
- Program: Gatecoin
- Found by: p4fg
- Disclosed: 2019-02-23
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/425314
- Library page: https://bugbountylibrary.com/r/h1%3A425314
- Tags: area:web domain:api impact:funds-loss impact:privesc kind:bounty platform:hackerone sev:medium technique:race-window vuln:access-control vuln:business-logic vuln:signature-replay

**Target:** Exchange REST API request signing / replay cache
**Root cause:** The request signature did not cover the request payload, and the anti-replay cache expired after 300 seconds while the timestamp validity window was also 5 minutes, leaving a gap when a client clock runs ahead of server time.
**Steps:**
1. Capture a signed API request (e.g. create read-only API key) whose client clock is a few seconds ahead of server time.
2. Wait ~299 seconds so the signature is evicted from the 300s replay cache but the timestamp is still within the 5-minute server window.
3. Resend the same signature to the same URL with a new payload (create API key with trade/withdraw privileges).
4. Retry a few times through the cache-eviction boundary until the request succeeds.
**How found:** Noticed the payload is not part of the signed data and that the replay cache (300s) and timestamp window (5 min) overlap when the client clock is ahead, then tested replaying a future-timestamped request after cache expiry.
**Exploitation:** Attacker who observes a signed request replays its signature against the same endpoint with a modified body, creating an API key with trading and withdrawal privileges; that key enables unfavorable trades or adding an attacker-controlled withdrawal wallet.
**Escalation:** Chains read-only key creation request into full-privilege key, then to fund loss via trading or withdrawal wallet addition.
**Insight:** When a replay cache TTL equals the timestamp validity window, a client clock skew creates a gap where a signature is evicted but still time-valid; check whether the signed data actually covers the body, and probe cache-eviction boundaries with future timestamps.

