#0706
Your API signs request bodies so the server can verify they weren't tampered with in transit.
The current implementation computes `sha256(secret + message)` and sends the hex digest as an `X-Signature` header.
Because SHA-256 is a Merkle-Damgård hash, an attacker who intercepts a valid `(message, sig)` pair can craft a valid signature for `message || padding || extension` without knowing the secret — a classic Hash Length Extension attack.
The fix is to use HMAC-SHA256, which is provably immune to this attack.
Hash length extension attacks have been exploited in real APIs (Flickr, Vimeo, Last.fm) to forge signed requests. Using HMAC costs nothing but prevents an entire class of cryptographic forgery.
sign('key', 'amount=100')// returns sha256('key' + 'amount=100') — forgeable!
sign('key', 'amount=100')// returns HMAC-SHA256('key', 'amount=100') — secure