information disclosure of secret_key_base via encoding charcters
A crafted encoding character in a request parameter triggered an error page that exposed the application's Rails secret_key_base to unauthenticated users. This secret would let an attacker forge or decrypt signed cookies, though remote code execution was not possible because cookies were serialised as JSON.
Originally disclosed on HackerOne
- Disclosed after 6 months
Summary by the program
@paresh_parmar discovered an error page that was disclosing the value of the secret_key_base key of customers.gitlab.com to unauthenticated users, which would have allowed an attacker to arbitrarily decrypt signed cookies.
Summary by the researcher
So I was fuzzing one parameter with different type of encodings. And one character threw error page .that page has secret token (rails)of application.
you can get RCE using a secret key base token. BUT in this case serialization was json action_dispatch.cookies_serializer"=>:json so RCE was not possible that time. still, you can do lots of stuff with secret_key_base of application, depends on the application logic.
thanks to @bugdiscloseguys for help and similar issue by @bugdiscloseguys At: https://blog.harshjaiswal.com/rce-due-to-showexceptions
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 debug or error page rendered in production that included application configuration, including the Rails secret_key_base, when an unexpected encoding character caused an exception.
Impact
An unauthenticated attacker could obtain the secret_key_base and use it to decrypt or forge signed cookies; RCE was not possible because the cookie serialiser was JSON, but other attacks depend on application logic.
What the attacker needed
Unauthenticated access; ability to send crafted encoded parameter
How it was found
- Fuzz a request parameter with different encodings.
- Send a character that triggers an application error page.
- Read the secret_key_base disclosed on that error page.
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.
Web applications often sign cookies with a secret value so users cannot tamper with them. Here an error page accidentally printed that secret value to anyone who sent a specially encoded character in a parameter. With the secret, an attacker could create or read signed cookies as if they were the server.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.