IDOR in Report CSV export discloses the IDs of Custom Field Attributes of Programs
The CSV export of reports accepted report IDs belonging to other programs and still included those programs' custom field columns in the header. An attacker could use this to learn the IDs of custom field attributes belonging to programs they do not have access to.
- Triaged in under an hour
- Fixed in 5 days
- Disclosed after 6 months
Specifying a report ID of another team when requesting a CSV export leaks the ID of the Custom Field Attribute in the CSV header.
Request
POST /reports/export HTTP/1.1
Host: localhost:8080
...
----------868143055
Content-Disposition: form-data; name="report_ids[]"
17
----------868143055
Content-Disposition: form-data; name="report_ids[]"
118
...
Response
HTTP/1.1 200 OK
...
id,title,severity_rating,severity_score,state,substate,weakness,reported_at,first_response_at,triaged_at,closed_at,awarded_at,assigned,reporter,bounty,bonus,public,reference,reference_url,structured_scope,original_report_id,custom_field_1,custom_field_2,custom_field_3,custom_field_4,custom_field_5,custom_field_6
17,Brute force in login form,low,,open,new,HTTP Response Splitting,2019-02-07 02:49:29 UTC,2019-02-07 02:49:30 UTC,,2019-02-07 02:49:30 UTC,,,sandra,,,no,,,https://profile-photos.hackerone-user-content.com/,,"'[a](https://google.com)',a",d,,,,
In the above request, report ID 17 belongs to the current user's program, which is why Custom Field 1, 2, 3, 4, and 6 are included. Custom Field 5 belongs to the Program for Report ID 118. The current user does not have access to this program, but the Custom Field is still included in the header. The program also doesn't have the feature toggle enabled, which means that this is currently exploitable on hackerone.com.
Impact
This can be used to get an exact count of Program Reports for Programs that have at least one attribute. This is currently exploitable on hackerone.com. However, as Custom Fields has not been released to other programs besides our own, there is currently no sensitive data being exposed.
Context
HackerOne's report export feature lets a user download a CSV of reports. The export is driven by a list of report IDs sent in the request body, and the resulting CSV has a fixed set of columns followed by a variable number of custom_field_N columns. Custom Fields are a per-program feature: a program can define custom attributes that appear on its reports, and those attributes are exported as extra columns in the CSV.
The report describes an IDOR in that export endpoint: by supplying a report ID belonging to a program the user cannot access, the CSV header still includes the custom field columns for that program, which discloses the ID of the Custom Field Attribute.
Setup
The request in the report is addressed to localhost:8080. The report does not describe any other accounts, roles or tooling.
Finding it
The researcher noticed that when a CSV export is requested with a report ID belonging to another team, the CSV header contains the custom field columns for that other program. The current user has no access to that program, yet its Custom Field Attribute ID is still reflected in the header. The program in question also does not have the feature toggle enabled, which the researcher notes means the issue is exploitable on hackerone.com at the time of writing.
Exploitation
Step 1: Send the export request with a foreign report ID
The request includes two report IDs in the report_ids[] form field: 17, which belongs to the current user's program, and 118, which belongs to a different program.
POST /reports/export HTTP/1.1
Host: localhost:8080
...
----------868143055
Content-Disposition: form-data; name="report_ids[]"
17
----------868143055
Content-Disposition: form-data; name="report_ids[]"
118
...
Step 2: Read the CSV header
The response is a 200 OK with a CSV body. The header row contains the standard columns followed by custom_field_1 through custom_field_6.
HTTP/1.1 200 OK
...
id,title,severity_rating,severity_score,state,substate,weakness,reported_at,first_response_at,triaged_at,closed_at,awarded_at,assigned,reporter,bounty,bonus,public,reference,reference_url,structured_scope,original_report_id,custom_field_1,custom_field_2,custom_field_3,custom_field_4,custom_field_5,custom_field_6
17,Brute force in login form,low,,open,new,HTTP Response Splitting,2019-02-07 02:49:29 UTC,2019-02-07 02:49:30 UTC,,2019-02-07 02:49:30 UTC,,,sandra,,,no,,,https://profile-photos.hackerone-user-content.com/,,"'[a](https://google.com)',a",d,,,,
In this output, report ID 17 belongs to the current user's program, which is why Custom Field 1, 2, 3, 4 and 6 are populated. Custom Field 5 belongs to the program for report ID 118. The current user does not have access to that program, but its custom field is still included in the header. The presence of the column, and its position, reveals the ID of the Custom Field Attribute for the other program.
Root cause
The report does not describe the code, so the exact cause is not stated.
The program in question did not have the feature toggle enabled, which the researcher highlights as the reason the issue was exploitable on hackerone.com at the time.
Impact
The researcher states that this can be used to get an exact count of program reports for programs that have at least one attribute. The issue was exploitable on hackerone.com at the time of the report. However, because Custom Fields had not been released to other programs besides the researcher's own, there was no sensitive data being exposed at that point.
Fix
Variants to test
- Supply a report ID from a program you do not belong to and check whether the CSV header contains
custom_field_Ncolumns that do not exist in your own program. A positive result is an extra column whose position or presence matches the foreign program's configuration. - Compare the header for a request containing only your own report IDs against one containing a foreign ID. A positive result is a header that grows when the foreign ID is added.
- Try the same pattern on other export endpoints that accept a list of object IDs (reports, findings, assets) and check whether metadata from objects you cannot access appears in the output.
Hunting notes
This kind of bug tends to hide in export and reporting endpoints that accept a list of IDs and build output columns dynamically from related records. During recon, look for endpoints that take *_ids[] parameters and return CSV, JSON or spreadsheet output. The signal is a response whose schema changes based on the IDs you supply. To show impact, demonstrate that a foreign ID changes the output in a way that reveals information about a program you cannot access, and note whether the feature is enabled for that program, since a disabled feature limits what is exposed.
Timeline
What happened, in plain words
HackerOne is a website where security researchers report bugs to companies (called "programs"). Each program can switch on a feature called Custom Fields: extra pieces of information that a program wants to collect on its reports. When a program defines these extra fields, they show up as extra columns in the CSV file that the export feature produces.
CSV (comma-separated values) is a plain text file that holds a table: one line per row, with commas between the cells. You can open it in a spreadsheet app. The first line is the header, which names each column.
The export feature works like this: you send the site a list of report numbers, and it sends back a CSV containing those reports. The researcher found that if you put a report number from a program you do not belong to into that list, the CSV header still grows to include that program's custom field columns. The column names are numbered (custom_field_1, custom_field_2, and so on), and the presence of the column reveals the ID of the Custom Field Attribute. That number is the ID of the Custom Field Attribute, and you are not supposed to be able to see it.
This kind of flaw is called an IDOR, short for Insecure Direct Object Reference. The name sounds technical, but the idea is simple: a website lets you refer to something by its number (a report, an invoice, a photo), and it forgets to check that the thing with that number actually belongs to you. It is like a hotel where the key card opens your own room, but the reception desk also hands out the room list to anyone who asks politely.
CVSS is a standard scoring system from 0 to 10 that tries to put a number on how bad a security flaw is.
The pieces involved
Before the steps make sense, here are the moving parts.
The export endpoint. An endpoint is a specific address on a website that does one job, like a service counter in a large building. This one is /reports/export. You send it a request, and it sends back a file.
The request body. When you fill in a form on a website and press submit, your browser sends the answers to the server. The server is the computer that runs the site. The answers travel in the request body, the part of the message that carries data rather than the address. The export form sends a list of report numbers this way.
Form data and boundaries. A browser can send several fields in one request using a format called multipart form data. Each field is wrapped in a boundary, a made-up line of dashes and digits that marks where one field ends and the next begins, so the server can tell them apart. The boundary in this report is ----------868143055.
The report_ids[] field. The square brackets in the name are a common convention meaning "this field can appear more than once, and together the values form a list". So the export request can carry several report numbers at once.
The response. The server answers with a status line and a body. 200 OK means the request succeeded. Here the body is the CSV file.
Custom Fields and the feature toggle. A feature toggle is an on/off switch that lets the site owners enable a feature for some programs and not others. Custom Fields is such a feature. The researcher notes that the other program did not have the toggle enabled, yet its custom field still appeared in the export, which is why the issue could be triggered on hackerone.com itself at the time.
Setting up
The request below is addressed to localhost:8080. localhost means "this computer", and 8080 is a port number, a door on that computer where the web server listens. Running a copy locally lets you experiment without touching the live site.
The report does not describe any other accounts, roles or tools.
Finding it
The researcher noticed that when a CSV export is requested with a report number belonging to another team, the CSV header contains that other program's custom field columns. The account has no access to that program, yet its Custom Field Attribute ID is still reflected in the header. The other program also did not have the feature toggle enabled, which the researcher says means the issue was exploitable on hackerone.com at the time of writing.
Exploitation
Step 1: Send the export request with a foreign report number
The request carries two report numbers in the report_ids[] field: 17, which belongs to the researcher's own program, and 118, which belongs to a different program.
POST /reports/export HTTP/1.1
Host: localhost:8080
...
----------868143055
Content-Disposition: form-data; name="report_ids[]"
17
----------868143055
Content-Disposition: form-data; name="report_ids[]"
118
...
Line by line:
POST /reports/export HTTP/1.1is the first line of an HTTP request. HTTP is the language browsers and servers use to talk.POSTis the method used when you are sending data, as opposed to simply asking for a page./reports/exportis the endpoint, andHTTP/1.1is the version of the protocol.Host: localhost:8080tells the server which site on that machine you want. Here it is the local copy on port 8080.- The
...lines stand for headers the report leaves out, such as the ones that identify your login session. ----------868143055is the boundary, the separator between fields.Content-Disposition: form-data; name="report_ids[]"labels the field that follows. The name isreport_ids[].17is the value of the first field: a report number from the researcher's own program.- The boundary appears again, then a second
report_ids[]field with the value118, a report number from a program the researcher does not belong to. - The final
...stands for the closing boundary and any other parts of the message the report leaves out.
Report 118 is the test: if the server checks permissions properly, it should either refuse that number or leave its program's custom fields out of the result. The request itself says nothing about which program each report belongs to. The server is expected to work that out and enforce access.
Step 2: Read the CSV header
The server answers 200 OK with a CSV body. The header row has the standard columns, then custom_field_1 through custom_field_6.
HTTP/1.1 200 OK
...
id,title,severity_rating,severity_score,state,substate,weakness,reported_at,first_response_at,triaged_at,closed_at,awarded_at,assigned,reporter,bounty,bonus,public,reference,reference_url,structured_scope,original_report_id,custom_field_1,custom_field_2,custom_field_3,custom_field_4,custom_field_5,custom_field_6
17,Brute force in login form,low,,open,new,HTTP Response Splitting,2019-02-07 02:49:29 UTC,2019-02-07 02:49:30 UTC,,2019-02-07 02:49:30 UTC,,,sandra,,,no,,,https://profile-photos.hackerone-user-content.com/,,"'[a](https://google.com)',a",d,,,,,
Line by line:
HTTP/1.1 200 OKis the status line.200means the request was accepted and the body follows.- The
...stands for response headers the report leaves out. - The long comma-separated line is the header row of the CSV. It starts with fixed columns such as
id,title,severity_rating,state,reporterandbounty, then ends withcustom_field_1tocustom_field_6. - The next line is the data row for report 17. Its
idis17, itstitleisBrute force in login form, itsseverity_ratingislow, itsstateisopen, and itsreporterissandra. Empty cells between commas mean that column had no value for this report. - In the custom field cells, the values are
"'[a](https://google.com)',a",d, and then empty cells. The quotes around the first value are how CSV keeps a cell that itself contains commas from being split into extra columns.
Now the important part. Report 17 belongs to the researcher's own program, which is why Custom Fields 1, 2, 3, 4 and 6 are filled in. Custom Field 5 belongs to the program that report 118 belongs to. The researcher has no access to that program, yet its custom field still appears in the header. The presence of the column, and where it sits, reveals the ID of the Custom Field Attribute for the other program.
Why it happens
The report does not describe the code, so the exact mechanism is not stated. A likely explanation is that the lookup of custom field definitions is filtered by report number rather than by which programs the user belongs to.
The other program did not have the feature toggle enabled, which the researcher highlights as the reason the issue was exploitable on hackerone.com at the time.
What someone could do with it
The researcher states that this can be used to get an exact count of program reports for programs that have at least one attribute. The issue was exploitable on hackerone.com at the time of the report. However, because Custom Fields had not been released to other programs besides the researcher's own, there was no sensitive data being exposed at that point. The report was rated low severity with a CVSS score of 3.8.
How it should be fixed
Similar things to test
- Supply a report number from a program you do not belong to and check whether the CSV header contains
custom_field_Ncolumns that do not exist in your own program. A positive result is an extra column whose position or presence matches the foreign program's configuration. - Compare the header for a request containing only your own report numbers against one containing a foreign number. A positive result is a header that grows when the foreign number is added.
- Try the same pattern on other export endpoints that accept a list of object numbers (reports, findings, assets) and check whether metadata from objects you cannot access appears in the output.
Where to look for this kind of bug
This kind of bug tends to hide in export and reporting endpoints that accept a list of numbers and build output columns dynamically from related records. During recon, meaning the early phase of exploring a target, look for endpoints that take *_ids[] parameters and return CSV, JSON or spreadsheet output. JSON is a text format for structured data, common in web APIs. An API is the part of a site built for programs to talk to rather than for people clicking pages. The signal is a response whose structure changes based on the numbers you supply. To show impact, demonstrate that a foreign number changes the output in a way that reveals information about a program you cannot access, and note whether the feature is enabled for that program, since a disabled feature limits what is exposed.
Timeline
The report was disclosed on 6 September 2019.
Glossary
- API: the part of a website built for other programs to talk to, rather than for people clicking through pages.
- Boundary: a made-up line of dashes and digits in a multipart request that marks where one form field ends and the next begins.
- CSV: comma-separated values, a plain text table format with one line per row and commas between cells.
- Custom Fields: a per-program HackerOne feature that adds extra information fields to a program's reports, exported as extra CSV columns.
- CVSS: a standard scoring system from 0 to 10 for rating the severity of a security flaw.
- Endpoint: a specific address on a website that performs one job, such as
/reports/export. - Feature toggle: an on/off switch that lets site owners enable a feature for some users or programs and not others.
- Form data (multipart): the format browsers use to send several fields in one request, with each field separated by a boundary.
- Header (HTTP): the lines at the top of a request or response that carry information about it, such as the host or the content type.
- Header row (CSV): the first line of a CSV file, which names each column.
- HTTP: the language browsers and servers use to exchange requests and responses.
- IDOR: Insecure Direct Object Reference, a flaw where a site lets you refer to something by its number without checking that it belongs to you.
- JSON: a text format for structured data, widely used by web APIs.
- localhost: the name a computer uses to refer to itself.
- Port: a numbered door on a computer where a network service listens, such as 8080.
- POST: the HTTP method used when sending data to a server, as opposed to simply requesting a page.
- Program: a company's bug bounty presence on HackerOne, which receives reports and can configure features such as Custom Fields.
- Recon: the early phase of exploring a target to find endpoints and features worth testing.
- Request body: the part of an HTTP request that carries data, such as form answers, rather than the address.
- Response: what the server sends back, including a status line, headers and usually a body.
- Server: the computer that runs a website and answers requests.
- Status code: the number at the start of a response, such as 200, saying whether the request succeeded.
report_ids[]: the form field name used to send a list of report numbers to the export endpoint.