Auth Bypass Via Exposed Credentials
Published on crypt0g30rgy.github.io
So it was on one of those days, i was feeling bored and kinda alone. When i feel like this i usually divulge into some hacking (to fill that void😃) So off i went to Intigriti and i saw that a program i followed had an update (funny story was i didn't recall having followed the program but i may have as well did, i get…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
The target was a program the researcher refers to as jij0, with *.jij0.me in scope and bounties of up to €1500 for an exceptional bug. The hosts involved are chat.jij0.me, which redirected to Microsoft online SSO, and admin.jij0.me, which returned a 401 and accepted the leaked Basic credential.
The feature that matters here is the redirect to Microsoft online SSO. When an unauthenticated visitor reaches chat.jij0.me, the application redirects them to Microsoft's identity provider. During the redirect the page loaded JavaScript files, and the main bundle was readable without logging in.
Setup
No accounts, roles or special tooling were needed. The researcher used:
- The Intigriti platform to find the program and its scope.
- The c99 Subdomain finder, pasting the domain and clicking start scan, which returned several hundred subdomains.
- A browser, including view-source, to read the front-end bundle.
- Burp to replay a request with an
Authorizationheader.
There were no credentials to start with. The whole exercise depends on the front-end bundle being publicly reachable and on the admin host being discoverable from the same bundle.
Finding it
The researcher visited the subdomains one by one and reached chat.jij0.me, which redirected to Microsoft online SSO. During the redirect the page loaded JavaScript files in the manner common to JavaScript frameworks connecting to a Node.js backend, which the researcher compares to the PHP Execution After Redirect (EAR) vulnerability: content is delivered before the redirect takes the user away.
To stop the redirect, the researcher used view-source: on the chat host:
view-source:https://chat.jij0.me
This exposed the main JavaScript file at https://chat.jij0.me/js/index.js. Knowing the backend was Node.js, the researcher searched that file for the NODE_ENV variable and found a configuration block of the following shape:
{NODE_ENV:"production",VUE_APP_ADMIN_URL:"https://ADMIN.JIJ0.ME",VUE_APP_VLS_BASIC_AUTH:"Basic [redacted]",VUE_APP_ENV:"PROD",VUE_APP_USEBOUNCER_API_KEY:"[redacted]",VUE_APP_VERSION:"1.33.7",BASE_URL:"/"}
Two things in that block are clearly not meant for the public. VUE_APP_ADMIN_URL points at the admin host, and VUE_APP_VLS_BASIC_AUTH carries a complete Authorization: Basic value. A third value, VUE_APP_USEBOUNCER_API_KEY, is also present in the block. The build version is 1.33.7 and the environment is PROD.
Exploitation
Step 1: Read the front-end bundle
Request https://chat.jij0.me/js/index.js directly, or use view-source: on the chat host to stop the SSO redirect. Search the bundle for NODE_ENV. The result is the configuration block above, which contains the admin URL and the Basic auth value.
Step 2: Confirm the admin host is protected
Visiting https://admin.jij0.me returned a 401 Unauthorized error. The same was true for https://admin.jij0.me/favicon.ico, which had previously returned a 401 as well. So the host was reachable but gated by Basic authentication.
Step 3: Replay the request with the leaked credentials
The researcher sent the following request with Burp, using the Basic value from the bundle:
GET /favicon.ico
HOST: admin.jij0.me
Authorization: Basic [redacted]
The Authorization header carries the base64 encoding of the username and password pair. Decoding it gives chatmeup:ontwitter0x01!, with chatmeup as the username and ontwitter0x01! as the password. The path /favicon.ico is the same one that had returned 401 before; this time the response was 200 OK.
Step 4: Observe the exposed data
With the credentials accepted, the researcher could see a large amount of information that was clearly not intended for the public. The researcher describes access to internal communications that exposed sensitive information, and says he was inside a government server. Testing stopped at that point. The researcher believed an attacker could leverage the access to escalate further, but did not attempt it.
Step 5: Report
The researcher wrote a report immediately, including screenshots and the vulnerable code snippet, and sent it to the program. The report was triaged within 45 minutes. Two days later a €700 bounty was paid.
Root cause
The mistake is that build-time configuration for a public front end included a secret. The configuration block was in the public JavaScript bundle, readable by anyone who could fetch it. Putting a Basic auth credential into VUE_APP_VLS_BASIC_AUTH therefore published the admin password to every visitor, and VUE_APP_ADMIN_URL published the host it unlocks. The same block also contained the VUE_APP_USEBOUNCER_API_KEY value.
The redirect to Microsoft SSO did not protect the bundle, because the bundle is served before the redirect takes effect. Basic authentication on the admin host did not help either: it is only a gate, and the gate's key was sitting in a public file. The likely fix is to keep such values out of the client build entirely and to have the front end call a backend endpoint that holds the secret server-side.
Impact
Anyone who fetched the public JavaScript bundle could read the admin URL and the Basic credential, then authenticate to admin.jij0.me and view internal data, including internal communications. The researcher characterises the host as a government server and the data as sensitive. The report does not enumerate the specific records viewed. The researcher also notes that further escalation seemed possible but was not tested, so the full extent of what an attacker could reach from that foothold is not established here.
Fix
The report does not describe a fix that was applied. Based on the finding, the credential should be removed from the client bundle and rotated, since it has been public. The admin host should not rely on a shared Basic credential that the front end knows about; access should be gated by something the client never sees. The VUE_APP_USEBOUNCER_API_KEY value in the same block should likewise be treated as compromised and rotated.
Variants to test
- Framework env blocks in public bundles. Fetch the main JS file of any SPA and grep for
NODE_ENV,VUE_APP_,REACT_APP_,NUXT_and similar prefixes. A positive result is a block containing URLs, keys orAuthorizationvalues that the app does not otherwise expose. - Redirect-gated front ends. On hosts that bounce to an SSO provider, use
view-source:or a proxy that stops the redirect, then read the bundle. A positive result is application configuration or API endpoints visible before authentication. - Admin hosts named in client config. Take any admin URL found in a bundle and request it unauthenticated. A
401confirms the host exists; replaying with any credential found in the same bundle and getting200confirms the bypass. - Basic auth values in client code. Decode any
Basicstring you find and try it against the host it appears next to, starting with a harmless path such as/favicon.ico. A change from401to200is the signal. - Third-party API keys in bundles. For any key found, check whether it is restricted by referrer or origin. A positive result is a key that works from an unrelated origin or reveals account data.
What happened, in plain words
A security researcher was bored one evening and decided to look for bugs on a bug bounty platform called Intigriti. Bug bounty platforms are websites where companies list their systems and offer money to anyone who finds a security problem in them, so long as the finder reports it privately instead of using it for harm. The researcher picked a program they refer to as jij0, which offered rewards of up to €1500 for an exceptional bug and had every subdomain of jij0.me in scope. "In scope" means the company has given permission to test those systems.
The researcher found a chat website, chat.jij0.me, and an admin website, admin.jij0.me. The chat site sent visitors to Microsoft's login service, and during that redirect it loaded a JavaScript file that anyone could read. That file contained, in plain text, the address of the admin site and a username and password for it. The researcher used those leaked credentials to get into the admin site, saw internal data that was not meant to be public, stopped testing immediately, and reported it. The report was triaged within 45 minutes and paid €700 two days later.
This article walks through the same steps for someone who has never done security testing before. Every technical idea is explained where it first appears.
Context
The target was a program the researcher calls jij0, with *.jij0.me in scope. The * is a wildcard: it means every subdomain of jij0.me, such as chat.jij0.me or admin.jij0.me, was fair game. Bounties went up to €1500 for an exceptional bug.
Two hosts matter here:
chat.jij0.me, a chat application. Its front end is a JavaScript single-page app talking to a Node.js backend.admin.jij0.me, an administrative interface protected by HTTP Basic authentication.
A few of those terms need unpacking.
Front end and backend. A web application usually has two halves. The front end is the part that runs in your browser: the pages, buttons and scripts. The backend is the part that runs on the company's server: it stores data, checks who you are and answers requests. Think of a restaurant: the front end is the dining room and menu you see, the backend is the kitchen you do not.
JavaScript. The programming language that browsers run. When a page loads, it can download JavaScript files that make the page interactive. Anyone can read those files, because the browser has to download them to run them.
Single-page app (SPA). A website built so that one page loads once and then swaps its content using JavaScript, instead of loading a fresh page for every click. Gmail is a familiar example.
Node.js. A way of running JavaScript on a server rather than in a browser. It is the backend technology here.
HTTP Basic authentication. A very old, very simple login method built into the web. The browser sends a header (a small line of extra information attached to a request) containing a username and password encoded in base64. Base64 is not encryption; it is just a way of writing data using letters and numbers, and anyone can decode it instantly. Basic auth is like a door with a keypad: if you know the code, you are in, and there is no second check.
The feature that matters here is the redirect to Microsoft online SSO. SSO stands for single sign-on: instead of the chat site checking your password itself, it hands you to Microsoft, which checks it and then sends you back. When an unauthenticated visitor (someone not logged in) reaches chat.jij0.me, the application redirects them to Microsoft's identity provider. A redirect is an instruction from the server saying "go to this other address instead".
The important detail: the bundle loaded during the redirect and could be read without logging in. A bundle is the packaged collection of JavaScript files that makes up the app. So the JavaScript that configures the application, including its build-time environment variables, is readable without logging in.
Environment variables. Settings passed into a program when it is built or started, such as addresses, feature switches and sometimes secrets. "Build-time" means they are baked into the files when the app is compiled, rather than looked up later on the server.
Setup
No accounts, roles or special tooling were needed. The researcher used:
- The Intigriti platform to find the program and its scope.
- The c99 Subdomain finder, pasting the domain and clicking start scan, which returned several hundred subdomains.
- A browser, including view-source, to read the front-end bundle.
- Burp to replay a request with an
Authorizationheader.
A few explanations:
Subdomain. A subdivision of a domain name. If jij0.me is the main building, chat.jij0.me and admin.jij0.me are named rooms inside it. Companies often have many, and forgotten ones are a classic source of bugs.
Subdomain finder. A website or tool that tries lots of common names (chat, admin, mail, dev and so on) against a domain and reports which ones exist. The researcher used the c99 Subdomain finder, pasted the domain and clicked start scan, and got several hundred results.
view-source. A browser feature. Typing view-source: before a URL shows the raw HTML the server sent, instead of rendering the page. The researcher used view-source: on the chat host to stop the redirect and read the page source.
Burp. Short for Burp Suite, a tool that sits between your browser and a website and lets you capture a request, edit it and send it again. Think of it as being able to intercept a letter, change a line, and post it again.
There were no credentials to start with. The whole exercise depends on the front-end bundle being publicly reachable and on the admin host being discoverable from the same bundle.
Finding it
The researcher visited the subdomains one by one and reached chat.jij0.me, which redirected to Microsoft online SSO. During the redirect the page loaded JavaScript files in the manner common to JavaScript frameworks connecting to a Node.js backend, which the researcher compares to the PHP Execution After Redirect (EAR) vulnerability: content is delivered before the redirect takes the user away.
Execution After Redirect. A class of bug where a server sends a redirect but also sends the page content along with it. The browser follows the redirect and the user never sees the content, but anyone who looks at the raw response, or stops the redirect, can read it. The comparison here is that the JavaScript is delivered before the redirect takes effect.
To stop the redirect, the researcher used view-source: on the chat host:
view-source:https://chat.jij0.me
Line by line: view-source: tells the browser to show the page's source code rather than run it. https://chat.jij0.me is the chat host. Because the browser is only displaying source, it does not carry out the redirect to Microsoft, so the researcher can read what the page contains.
This exposed the main JavaScript file at https://chat.jij0.me/js/index.js. Knowing the backend was Node.js, the researcher searched that file for the NODE_ENV variable and found a configuration block of the following shape:
{NODE_ENV:"production",VUE_APP_ADMIN_URL:"https://ADMIN.JIJ0.ME",VUE_APP_VLS_BASIC_AUTH:"Basic [redacted]",VUE_APP_ENV:"PROD",VUE_APP_USEBOUNCER_API_KEY:"[redacted]",VUE_APP_VERSION:"1.33.7",BASE_URL:"/"}
This is a JavaScript object: a list of named settings and their values, written as name:value pairs separated by commas. Going through it:
NODE_ENV:"production"says the app is running in production mode, meaning the live, real-world version rather than a test copy.VUE_APP_ADMIN_URL:"https://ADMIN.JIJ0.ME"gives the address of the admin site. TheVUE_APP_prefix is a naming convention in Vue, a popular JavaScript framework: variables with that prefix are deliberately copied into the browser-side bundle.VUE_APP_VLS_BASIC_AUTH:"Basic [redacted]"is a completeAuthorization: Basicvalue, the kind a browser sends when logging in with Basic authentication. The long string afterBasicis base64-encoded credentials.VUE_APP_ENV:"PROD"repeats that this is the production environment.VUE_APP_USEBOUNCER_API_KEY:"[redacted]"is another value in the block. An API key is a password-like string that lets software talk to another service on your behalf.VUE_APP_VERSION:"1.33.7"is the build version.BASE_URL:"/"sets the base path for the app's links.
Two things in that block are clearly not meant for the public. VUE_APP_ADMIN_URL points at the admin host, and VUE_APP_VLS_BASIC_AUTH carries a complete Authorization: Basic value. A third value, VUE_APP_USEBOUNCER_API_KEY, is also present in the block. The build version is 1.33.7 and the environment is PROD.
The lesson to take from this block: anything with a VUE_APP_ prefix is shipped to every visitor's browser. It is public by design. Putting a password in it is like printing the key to the staff room on the menu.
Exploitation
Step 1: Read the front-end bundle
Request https://chat.jij0.me/js/index.js directly, or use view-source: on the chat host to stop the SSO redirect. Search the bundle for NODE_ENV. The result is the configuration block above, which contains the admin URL and the Basic auth value.
Why this step: the bundle is public, so no login is needed. Searching for NODE_ENV is a shortcut to the configuration section, because that variable name almost always sits next to the other settings.
Step 2: Confirm the admin host is protected
Visiting https://admin.jij0.me returned a 401 Unauthorized error. The same was true for https://admin.jij0.me/favicon.ico, which had previously returned a 401 as well. So the host was reachable but gated by Basic authentication.
HTTP status codes. Three-digit numbers a server sends back with every response. 200 OK means success. 401 Unauthorized means "you need to log in first". 404 Not Found means the address does not exist. Seeing 401 rather than 404 is useful: it proves the site is there and simply wants credentials.
favicon.ico. The tiny icon shown in a browser tab. It is a small, harmless file, which makes it a good test target: you can check whether credentials work without touching any real data.
Why this step: before trying the leaked password, the researcher confirmed the door was locked. That makes the next result meaningful.
Step 3: Replay the request with the leaked credentials
The researcher sent the following request with Burp, using the Basic value from the bundle:
GET /favicon.ico
HOST: admin.jij0.me
Authorization: Basic [redacted]
Line by line:
GET /favicon.icois the request line.GETis the HTTP method used to ask for a file or page, and/favicon.icois the path being asked for.HOST: admin.jij0.metells the server which site the request is for. One server can host many sites, so this line picks the right one.Authorization: Basic [redacted]is the login line.Basicnames the scheme, and the string is the base64-encoded username and password copied from the bundle.
The Authorization header carries the base64 encoding of the username and password pair. Decoding it gives chatmeup:ontwitter0x01!, with chatmeup as the username and ontwitter0x01! as the password. The colon separates the two. The path /favicon.ico is the same one that had returned 401 before; this time the response was 200 OK.
Why this step: the researcher already knew the door was locked and already had a key from a public file. Sending the request by hand with Burp, rather than through a normal browser login box, makes it easy to see exactly what is sent and what comes back. A change from 401 to 200 is proof the key works.
Step 4: Observe the exposed data
With the credentials accepted, the researcher could see a large amount of information that was clearly not intended for the public. The researcher describes access to internal communications that exposed sensitive information, and says he was inside a government server. Testing stopped at that point. The researcher believed an attacker could leverage the access to escalate further, but did not attempt it.
Why stop: once you have proven you can get in, the responsible thing is to stop and report. Poking around further risks reading other people's private data or changing something by accident. The report does not list the specific records that were viewed.
Step 5: Report
The researcher wrote a report immediately, including screenshots and the vulnerable code snippet, and sent it to the program. The report was triaged within 45 minutes. Two days later a €700 bounty was paid.
Triaged. Reviewed by the company or platform to confirm the bug is real and in scope, and to set its severity. A fast triage means the report was clear enough to act on straight away.
Root cause
The mistake is that build-time configuration for a public front end included a secret. In a Vue application, variables prefixed VUE_APP_ are compiled into the client bundle and are readable by anyone who can fetch the JavaScript. Putting a Basic auth credential into VUE_APP_VLS_BASIC_AUTH therefore published the admin password to every visitor, and VUE_APP_ADMIN_URL published the host it unlocks. The same block also contained the VUE_APP_USEBOUNCER_API_KEY value.
The redirect to Microsoft SSO did not protect the bundle, because the bundle is served before the redirect takes effect. Basic authentication on the admin host did not help either: it is only a gate, and the gate's key was sitting in a public file. The likely fix is to keep such values out of the client build entirely and to have the front end call a backend endpoint that holds the secret server-side.
Endpoint. A specific address on a server that performs one job, such as "check a login" or "return a list of messages". The idea behind the fix is that the browser asks the backend to do the privileged thing, and the backend holds the secret where visitors cannot read it.
Impact
Anyone who fetched the public JavaScript bundle could read the admin URL and the Basic credential, then authenticate to admin.jij0.me and view internal data, including internal communications. The researcher characterises the host as a government server and the data as sensitive. The report does not enumerate the specific records viewed. The researcher also notes that further escalation seemed possible but was not tested, so the full extent of what an attacker could reach from that foothold is not established here.
In plain terms: no skill was needed beyond opening a public file and copying a line out of it. That is what makes leaked secrets in front-end code so serious.
Fix
The report does not describe a fix that was applied. Based on the finding, the credential should be removed from the client bundle and rotated, since it has been public. The admin host should not rely on a shared Basic credential that the front end knows about; access should be gated by something the client never sees. The VUE_APP_USEBOUNCER_API_KEY value in the same block should likewise be treated as compromised and rotated.
Rotated. Replaced with a new value, with the old one switched off. Once a password or key has been public, changing it is the only way to make it safe again.
Variants to test
These are the same ideas applied more widely. They are for people testing systems they are authorised to test.
- Framework env blocks in public bundles. Fetch the main JS file of any SPA and grep for
NODE_ENV,VUE_APP_,REACT_APP_,NUXT_and similar prefixes. A positive result is a block containing URLs, keys orAuthorizationvalues that the app does not otherwise expose. Grep is a command-line search tool; the prefixes are the naming conventions used by different frameworks for variables that get copied into the browser bundle. - Redirect-gated front ends. On hosts that bounce to an SSO provider, use
view-source:or a proxy that stops the redirect, then read the bundle. A positive result is application configuration or API endpoints visible before authentication. - Admin hosts named in client config. Take any admin URL found in a bundle and request it unauthenticated. A
401confirms the host exists; replaying with any credential found in the same bundle and getting200confirms the bypass. - Basic auth values in client code. Decode any
Basicstring you find and try it against the host it appears next to, starting with a harmless path such as/favicon.ico. A change from401to200is the signal. - Third-party API keys in bundles. For any key found, check whether it is restricted by referrer or origin. A positive result is a key that works from an unrelated origin or reveals account data. Referrer and origin are pieces of information a browser sends about which site a request came from; services can use them to refuse requests from anywhere else.
Glossary
- API: a defined way for one piece of software to ask another for something, like a service counter with set requests.
- API key: a password-like string that lets software use a service on your behalf.
- Authorization header: the line in an HTTP request that carries login information.
- Backend: the server-side part of an application that stores data and makes decisions.
- Base64: an encoding that turns data into letters and numbers. It is not encryption and anyone can decode it.
- Basic authentication: a simple login scheme where the browser sends a username and password, base64-encoded, in a header.
- Bug bounty: a programme that pays people for reporting security problems privately.
- Bundle: the packaged JavaScript files a web app sends to the browser.
- Burp (Burp Suite): a tool that captures, edits and resends web requests.
- Endpoint: a specific address on a server that performs one job.
- Environment variables: settings passed into a program at build or start time.
- Execution After Redirect (EAR): a bug where content is sent along with a redirect, so it can be read by anyone who stops the redirect.
- favicon.ico: the small icon shown in a browser tab; a harmless file often used to test access.
- Front end: the part of an application that runs in the browser.
- GET: the HTTP method used to ask for a file or page.
- Grep: a command-line tool for searching text.
- Host header: the line in a request that says which site the request is for.
- HTTP status code: a three-digit number in a response, such as
200 OKor401 Unauthorized. - JavaScript: the programming language browsers run.
- Node.js: a way of running JavaScript on a server.
- Origin / referrer: information a browser sends about which site a request came from.
- Redirect: a server instruction to go to a different address.
- Rotate: replace a secret with a new one and disable the old one.
- Scope: the list of systems a programme has authorised for testing.
- Single-page app (SPA): a site that loads once and swaps content with JavaScript.
- SSO (single sign-on): a login handled by one central provider on behalf of other sites.
- Subdomain: a named subdivision of a domain, such as
chat.jij0.meunderjij0.me. - Triaged: reviewed and confirmed as a real, in-scope bug.
- view-source: a browser prefix that shows a page's raw source instead of running it.
- Vue: a JavaScript framework for building user interfaces; its
VUE_APP_variables are copied into the browser bundle. - Wildcard (
*): a symbol meaning "anything", so*.jij0.mecovers every subdomain.