Skip to content
Info disclosure Write-up Beginner

I am able to see user’s sensitive data through JSON file.

A JSON file used by the web application exposed user credentials and other sensitive data in its response, even after logout. An attacker could view this data by inspecting the JSON file, potentially obtaining passwords and personal information.

Saurabh siddharam sanmane Follow

Published on medium.com

Bounty$150 View original

Saurabh siddharam sanmane

Saurabh siddharam sanmane, on medium.com

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

This is a short write-up about information disclosure through JSON responses. The author describes two scenarios, both on sites he calls target.com, where a JSON file used by the application to exchange data with the server returned more than it should. In the first scenario the feature is user creation and invitation: the application lets an administrator create or invite users with a username and password, and the data for those users is stored on the server and served through a JSON file. In the second scenario the feature is the account details page and the profile page, which returned user data including the password in encrypted form, address and contact details.

The weakness is information disclosure: the sensitive values appear in the response body rather than in request parameters, and in the first scenario they remained visible after the author logged out.

Setup

The author does not name the program or the exact host, and gives no versions. The only tool mentioned is Mozilla's inspector, used instead of Burp Suite to verify the issue. The precondition in the first scenario is an account on the target with the ability to create or invite users with a username and password; the author created one such user. In the second scenario the precondition is simply an authenticated account with access to the account details and profile pages.

Finding it

The author was looking for vulnerabilities on the target and, after failing with other approaches, started reviewing the application's files and pages. He noticed that the site offered an option to create or invite users with a username and password, so he created one.

When a user is added or configured in the domain, the information is stored on the server in a JSON file. Inspecting that particular file showed that the JSON file was leaking information about the added user. The author expected the data to be shown because he was logged in, but after logging out the information, including the password, was still shown. His reasoning is that a password visible in request parameters would not be a problem, but a password visible in the response is the issue.

Exploitation

The author used Mozilla's inspector rather than Burp Suite to verify the vulnerability, and gives four steps.

Step 1: open the inspector

Open the website inspector.

Step 2: add a user and find the JSON file

Add the user, then look at the JSON file whose name is the ID.

Step 3: check cookies, parameters and response

Check the information in cookies, parameters and the response.

Step 4: read the leaked data in the response

The response contains the data leakage: password, username and ID. The screenshot shows the GET method used by the JSON file to retrieve the data.

The image shows the inspector view of the JSON response with the sensitive data. The author labels it "see sensitive data". The report does not reproduce the request or response text itself, so the exact endpoint, parameter names and values are not available here.

He reported the bug to the program on Bugcrowd. The program changed the severity from P3 to P4, and he received a reward.

The second image shows the reward.

Second scenario: account details and profile pages

In the second scenario, going to the account details page leaked a lot of data related to the user: username, password in encrypted form, address and contact details. Following the same steps on the profile page produced the same kind of details.

details realted user From the original on medium.com

The image shows the user details returned on the account details page.

The image shows the password field in the leaked data.

Root cause

The report describes the behaviour rather than the code. The JSON file used to exchange data between the application and the server returned the full user record, including the password, to the client. The author observed that the data, including the password, was still shown after he logged out; the report does not show the request that proves this, so the exact mechanism is not established. In the second scenario the account details and profile pages embedded the same kind of record, with the password in encrypted form, in what the browser received.

Likely the server serialised the whole user object into the JSON response instead of a filtered view.

Impact

The leaked fields named in the report are username, password (plain in the first scenario, encrypted in the second), ID, address and contact details. The author states that the data remained visible after logout in the first scenario. The author could read those fields in the responses he inspected. The report does not describe how an unauthenticated attacker would discover the file name, which in the first scenario is the user ID, so the practical reach beyond the author's own session is not shown. The program treated the issue as P4 after initially rating it P3, and paid a reward of 150.00 USD.

Fix

Based on the described behaviour, the response should return only the fields the page needs, should never include the password or its encrypted form, and should be restricted to the authorised session so that it is not served after logout.

Variants to test

  1. Create a user through an invitation or administration feature and watch the inspector's network panel for a JSON request whose name matches the new object's ID. A positive result is a response containing the username, password or other fields the form did not need to display.
  2. Repeat the same request after logging out, or from a private window without cookies. A positive result is the same JSON body coming back without a valid session.
  3. Visit account details and profile pages while watching for JSON or embedded data. A positive result is fields such as address, contact details or a password hash appearing in the response body rather than being rendered from a minimal API call.
  4. Change the ID in the JSON file name to another user's ID. A positive result is another user's record being returned, which would confirm the broken authorisation rather than only over-exposure of your own data.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

A security researcher found that a website was handing out more information about its users than it should, in two scenarios. When you use a website, your browser and the website's server constantly exchange small packages of data. One common format for those packages is called JSON. The researcher noticed that some of these JSON packages contained private details about users, including usernames, passwords, addresses and contact information, and that in one case the details were still visible after logging out.

Think of it like a bank teller who, instead of handing you a slip showing only your account balance, hands you the entire customer file: your name, your password, your home address and your phone number. The teller was only supposed to give you the balance, but the whole file came along for the ride. That is what was happening here: the website was sending the full user record to the browser when it only needed to send a small part of it.

The researcher reported the issue to the company through a bug bounty platform called Bugcrowd. Bug bounty platforms are places where companies invite people to look for security problems and pay them for reporting what they find. The company first rated the issue P3, then changed it to P4, and paid a reward. P3 and P4 are severity ratings: P3 is more serious than P4, so the company decided the problem was less severe than it first appeared.

This write-up covers two separate scenarios on sites the author calls target.com. In the first, the feature involved was creating or inviting users with a username and password. In the second, the feature was the account details page and the profile page. Both scenarios had the same underlying problem: the server sent back more data than the page needed, and that data included sensitive fields.

Background: what JSON is and why it matters

Before looking at the steps, it helps to understand what a JSON file is. JSON stands for JavaScript Object Notation. It is a way of writing data as text so that a computer program can read it easily. A JSON file stores simple data structures and objects in that format, and it is a standard way for programs to exchange data. It is mainly used for transmitting data between a web application and a server.

Here is a simple everyday comparison. Imagine you are ordering a pizza by phone. You tell the person on the other end what you want, and they read it back to you in a fixed order: size, crust, toppings, address. JSON is like that fixed order: a agreed way of writing things down so both sides understand each other without confusion. A JSON file might look like a list of labels and values, for example a label username with a value next to it, or a label id with a number next to it.

When you use a website, your browser sends requests to the server, and the server sends responses back. A request is simply a message asking for something, such as a page or a piece of data. A response is the server's reply. JSON is often used in responses because it is compact and easy for programs to read.

One important detail is the difference between request parameters and the response body. Request parameters are the pieces of information your browser sends to the server, for example when you fill in a form. The response body is what the server sends back. The researcher's point is that a password appearing in request parameters would not be a problem by itself, because you typed it in. A password appearing in the response is a problem, because the server is sending it back to the browser when it does not need to.

The vulnerability

Sometimes a JSON file is used to retrieve data from the server, using what is called the GET method. A method is simply the type of request being made. GET is used to ask for data, as opposed to sending data. The researcher explains the vulnerability through two scenarios.

First scenario: creating or inviting users

The researcher was looking for vulnerabilities on the target and tried almost every way he could think of to exploit one. When those attempts failed, he started looking through the site's files and pages. He noticed that the site had an option to create or invite users with a username and password, so he created one user.

When a user is added or configured in the domain, the information is stored on the server using a JSON file. When the researcher inspected that particular file, he saw that the JSON file was leaking information about the user he had added. He expected the information to be shown because he was logged in, but when he logged out, the information, including the password, was still shown. His reasoning is that a password visible in request parameters would not be a problem, but a password visible in the response is the issue.

This is the core of the problem. The server was sending back the full user record, including the password, in a response that the browser could read. The fact that it was still visible after logout suggests the response was not properly tied to a logged-in session. The report does not show the exact request that proves this, so the precise mechanism is not established.

Steps to reproduce

Instead of Burp Suite, the researcher used Mozilla's inspector to verify the vulnerability. Burp Suite is a tool that sits between your browser and the server and lets you inspect and modify traffic. Mozilla's inspector is the built-in developer tool in the Firefox browser, which lets you look at the page's structure and the network requests it makes. The researcher used the inspector to verify the vulnerability.

  1. Open the website inspector.
  2. Add the user, then look at the JSON file whose name is the ID.
  3. Check the information in cookies, parameters and the response.
  4. In the response there is data leakage: password, username and ID.

Let us go through each step in plain words.

Step 1: open the website inspector. The inspector is a panel built into the browser. You open it with a keyboard shortcut or from the browser menu. It shows you what the page is made of and what requests the browser is making behind the scenes. The researcher opened it so he could watch the data flowing between the browser and the server.

Step 2: add the user and find the JSON file. He used the site's feature to create or invite a user with a username and password. Then he looked through the requests the browser made and found a JSON file whose name was the ID of the user he had just created. An ID is a unique identifier, a number or string the system uses to tell one record apart from another. The fact that the file was named after the ID is a clue: the server was serving a file per user record.

Step 3: check cookies, parameters and the response. Cookies are small pieces of data that a website stores in your browser, often used to remember that you are logged in. Parameters are the pieces of information sent with a request. The response is what comes back. The researcher checked all three so he could see exactly where the sensitive data appeared. This matters because the location tells you what kind of problem it is: data in a request parameter is something you sent, while data in a response is something the server sent back to you.

Step 4: read the leaked data in the response. The response contained the data leakage: password, username and ID. The screenshot shows the GET method used by the JSON file to retrieve the data.

The image shows the inspector view of the JSON response with the sensitive data. The researcher labels it "see sensitive data". The report does not reproduce the request or response text itself, so the exact endpoint, parameter names and values are not available here.

He reported the bug to the program on Bugcrowd. The program changed the severity from P3 to P4, and he received a reward.

The second image shows the reward.

Second scenario: account details and profile pages

In the second scenario, going to the account details page leaked a lot of data related to the user: username, password in encrypted form, address and contact details. Following the same steps on the profile page produced the same kind of details.

details realted user From the original on medium.com

The image shows the user details returned on the account details page.

The image shows the password field in the leaked data.

In this scenario the password was in encrypted form rather than plain text. Encryption is a way of scrambling data so that it cannot be read without the right key. An encrypted password is still sensitive: it is not the same as the original password, but it is still user data the page did not need to send. The report does not say which encryption was used.

Why this happens

The report describes the behaviour rather than the code. The JSON file used to exchange data between the application and the server returned the full user record, including the password, to the client. The researcher's observation that the data was still returned after logout suggests the response was not tied to the authenticated session, or that the file was reachable without one. In the second scenario the account details and profile pages embedded the same kind of record, with the password in encrypted form, in what the browser received.

A likely explanation is that the server took the whole user object and turned it into JSON, instead of picking only the fields the page needed. Another likely explanation is that no server-side check restricted the response to the fields the page needed. Authorisation is the process of checking whether the person making a request is allowed to do so. When that check is missing or broken, data can be served to people who should not see it.

Impact

The leaked fields named in the report are username, password (plain in the first scenario, encrypted in the second), ID, address and contact details. The researcher states that the data remained visible after logout in the first scenario. The researcher could read those fields in the responses he inspected. The program treated the issue as P4 after initially rating it P3, and paid a reward of 150.00 USD.

Fix

Based on the described behaviour, the response should return only the fields the page needs, should never include the password or its encrypted form, and should be restricted to the authorised session so that it is not served after logout.

Variants to test

If you want to look for similar problems yourself, here are some things to try. Each one is a small experiment you can run in your own browser with the inspector open.

  1. Create a user through an invitation or administration feature and watch the inspector's network panel for a JSON request whose name matches the new object's ID. A positive result is a response containing the username, password or other fields the form did not need to display.
  2. Repeat the same request after logging out, or from a private window without cookies. A positive result is the same JSON body coming back without a valid session.
  3. Visit account details and profile pages while watching for JSON or embedded data. A positive result is fields such as address, contact details or a password hash appearing in the response body rather than being rendered from a minimal API call.
  4. Change the ID in the JSON file name to another user's ID. A positive result is another user's record being returned, which would confirm the broken authorisation rather than only over-exposure of your own data.

Glossary

  • API: a way for one piece of software to ask another for data or actions, like a waiter taking your order to the kitchen.
  • Authorisation: the process of checking whether the person making a request is allowed to do so.
  • Bug bounty: a programme where companies pay people for reporting security problems.
  • Bugcrowd: a platform that hosts bug bounty programmes.
  • Burp Suite: a tool that sits between your browser and a server so you can inspect and modify traffic.
  • Cookie: a small piece of data a website stores in your browser, often used to remember that you are logged in.
  • Encryption: scrambling data so it cannot be read without the right key.
  • Endpoint: the address of a specific piece of functionality on a server.
  • GET: a type of request used to ask for data.
  • ID: a unique identifier used to tell one record apart from another.
  • Information disclosure: a problem where a system reveals data it should not.
  • Inspector: a panel built into a browser that shows the page's structure and the requests it makes.
  • JSON: a text format for writing data so programs can read it easily.
  • Method: the type of a request, such as GET.
  • Parameter: a piece of information sent with a request.
  • P3 / P4: severity ratings, where P3 is more serious than P4.
  • Request: a message from your browser asking the server for something.
  • Response: the server's reply to a request.
  • Session: the period during which a website remembers that you are logged in.
  • Severity: how serious a security problem is judged to be.
  • Vulnerability: a weakness in a system that can be used to cause harm.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.