Authentication Issue for easter egg on bonjour.uber.com
The passcode for an easter egg on bonjour.uber.com was stored as a plain JavaScript variable, so anyone viewing the source could read it. An attacker could then type the passcode to trigger a test error, but the impact is minimal.
- Disclosed after 14 days
Summary by the researcher
Easter egg's code was insecure :P
The report
This probably (ok, almost definitely) is just informative but thought I would throw it out here anyways. :)
bonjour.uber.com hosts an easter egg (view source and scroll down) where the passcode is insecurely stored as a javascript variable. The source for the easter egg is:
<script type="text/javascript">//error easter egg - call stack is intentionally complex
var pressed = [];
var passcode = 'abcde';
document.addEventListener('keypress', keyPressed);
function keyPressed(e) {
pressed.push(String.fromCharCode(e.charCode));
if (pressed.join('') == passcode) {
throw new Error('sentry test');
pressed = [];
}
if (passcode.indexOf(pressed.join(''))) {
pressed = [];
}
}
</script>
The problem is that the passcode is stored as a string which means I can analyze the code in order to figure out that I must type in abcde to get the sentry test error. Instead of including it that way, I would like to suggest the following code change to increase security:
var pressed = [];
var hashedPasscode = '03de6c570bfe24bfc328ccd7ca46b76eadaf4334';
document.addEventListener('keypress', keyPressed);
function keyPressed(e) {
pressed.push(String.fromCharCode(e.charCode));
if (sha1(pressed.join('') )== hashedPasscode) {
throw new Error('sentry test');
pressed = [];
}
}
You could even switch to scrypt or some other more secure hashing algorithm for added security! :P
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
The passcode was stored in plaintext in client-side JavaScript, making it visible to anyone who inspects the page source.
Impact
An attacker could discover the passcode and trigger a test error, but the impact is limited to that easter egg.
What the attacker needed
Access to the website
The fix
The passcode should be stored as a hash (e.g., SHA-1 or scrypt) instead of plaintext, so it cannot be read directly from the source.
How it was found
- View the source of bonjour.uber.com and scroll down to find the easter egg code.
- Read the JavaScript variable containing the passcode.
- Type the passcode to trigger the test error.
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.
A website had a hidden feature (an easter egg) that required typing a secret code. The code was written directly in the page's code, so anyone could see it by looking at the page source. This is like hiding a key under a doormat: it's not really hidden.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.