Details
This is a Slack Morphism vulnerability rather than an Axum/Hyper or downstream application issue because Slack Morphism itself:
- computes the correct HMAC;
- places it into its own public error type;
- exposes it through
DebugandDisplay; - and, in the default Axum path, sends it to its own error logger.
Signature verification is enabled and correctly configured in the reproduction.
Suggested remediation
The safest fix is to remove generated_hash from SlackEventWrongSignatureError entirely.
The expected HMAC should not be retained in a public error object because merely changing Display would still leave other disclosure paths such as derived Debug, callers inspecting the public field, or nested error formatting.
Signature mismatch errors should contain only non-sensitive diagnostic information.
I also recommend:
- implementing sanitized
DebugandDisplayrepresentations for verification errors; - reviewing all Axum and Hyper signature-error sinks;
- returning an ordinary sanitized HTTP authentication failure from the Hyper integration instead of exposing cryptographic verification state as a service error;
- adding equivalent regression coverage for Events API, commands, and interactions; and
- advising users whose logs exposed
generated_hashvalues to rotate the Slack signing secret if those logs were accessible to an untrusted party.
A regression test can directly assert that the expected HMAC is absent from both representations:
let error = verifier.verify(BOGUS, BODY, TIMESTAMP).unwrap_err();
assert!(!format!("{error:?}").contains(CORRECT_HMAC));
assert!(!format!("{error}").contains(CORRECT_HMAC));
An integration regression test should additionally verify that default listener logs do not contain the expected HMAC and that a request using the original invalid signature never reaches the application callback.