Skip to content
Business logic Write-up Intermediate

How I Got My First CVE

An unauthenticated API endpoint for account registration did not check if an email was already registered, so re-submitting an existing email created a new account ID and wiped the original account. An attacker could wipe any user's account, including admins, and an email enumeration endpoint helped identify targets.

Tobydavenn Follow

Published on medium.com

I hope everyone is well. Some exciting things have happened this week, one of those being my first CVE achieved.

Tobydavenn, 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 the story of how I obtained my first CVE, CVE-2022-35863. The vulnerability was a high severity unauthenticated remote account wiping vulnerability in a well used piece of software. That software was in use across a range of private sectors, including military and government as well as healthcare. I stumbled across the vulnerability while taking part in the US DOD bug bounty, on an in-scope asset.

The affected feature is account registration. The application exposes a POST request to an API endpoint that creates an account from the details submitted, including the email address, account details and password. Normally that endpoint should refuse to act on an email address that already belongs to an account. In this version it did not.

At the time of writing the CVE was in the last stages of assignment, so the details were not yet public. I therefore do not name company names or give exact proof of concept code. The CVE ID is CVE-2022-35863.

Setup

I had been testing on example.com for a couple of weeks. By that point I had reported several vulnerabilities, and as a result I had a huge Burp Suite file. The tools involved were:

  1. Burp Suite, used as the proxy and for Repeater.
  2. Kite Runner and other discovery tools, used for recon and site crawling, with the results fed directly into the Burp Suite Proxy.
  3. The target's client side application and its JavaScript files, which I read to find further endpoints.

The attack is unauthenticated: no login of the attacker's own is required.

Finding it

I wanted to make sure I had got everything I could before moving on from the target. That is when I went back to my target tab and filtered by POST requests displaying parameters.

After deep recon and site crawling, feeding the results directly to my Burp Suite Proxy, testing every endpoint available on the client side and also reading JavaScript files for further endpoints, I noticed a POST request with a weird API endpoint of the form blah/blah/DEFAULT. Looking it over, I saw that this was my account registration URL, and that it carried my email address, account details and password.

I sent it to Repeater and did not think much about it at first. Then, while testing for CSRF, I tampered with the request by sending it with my already registered email address. The response came back 200 OK with an ID assigned to my account, and that was not the ID I had noted down for my account when testing IDORs. That looked wrong.

I went to log in again and got an error message saying, "Please confirm your email". I had confirmed it earlier. I went back to my email, confirmed the account, and when I logged in my account was blank and brand new. I had wiped it.

Exploitation

Step 1: Capture the registration request

While reviewing the POST requests with parameters in my Burp Suite file, I identified the account registration request. It pointed at an API endpoint of the form blah/blah/DEFAULT and contained the email address, account details and password for the account being registered. I sent it to Repeater.

Step 2: Replay it with an already registered email address

In Repeater I tampered with the request, sending it with my already registered email address while testing for CSRF. The server answered 200 OK and returned an ID assigned to my account. That ID was different from the one I had noted for my account during IDOR testing.

Step 3: Observe the effect on the account

When I tried to log in again, I received the error "Please confirm your email", even though I had confirmed the address earlier. After confirming the account again through my email and logging in, the account was blank and brand new. The original account had been wiped.

Step 4: Confirm with a second address

I went back to the request and entered another test email address on the same API endpoint. That account was wiped as well.

Step 5: Enumerate accounts first (optional stage)

There was also, conveniently, an API endpoint that validated existing email addresses. That endpoint could be used as stage 1 of the attack, to enumerate active accounts before wiping them.

Root cause

The API endpoint was not validating whether accounts were already registered. It simply assigned new IDs to the email address that was input, which meant that anyone's account could be wiped. The new ID overwrote the existing record, so all data held on the application for that account was removed.

The report does not describe any server side defence that was present and failed.

Impact

The CVE proves that any user's account, even an administrator's, can be completely wiped and reset, with all data held on the application for that account removed, because the new ID overwrote it. The attack is unauthenticated and remote. I analysed the technology in use on the site and at the software company and identified that this affected all of their sites running this version, which was the latest.

Fix

The report does not state what was changed.

Variants to test

  1. Replay a registration request with an email address that is already registered. A positive result is a 200 OK carrying a new account ID that differs from the one you recorded for that account.
  2. After the replay, attempt to log in with the original credentials. A positive result is a "please confirm your email" style error or a login into an empty, freshly created account.
  3. Look for a separate endpoint that validates whether an email address exists, and use it to enumerate active accounts before testing the registration endpoint against them.
  4. Filter your proxy history by POST requests with parameters and inspect the registration endpoint, such as blah/blah/DEFAULT, for the same missing existence check.
  5. Read JavaScript files for further endpoints, as was done here.

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. 13 min read.

What happened, in plain words

A security researcher found a bug in a piece of software that many organisations use. The bug let anyone, without logging in, wipe another person's account completely: all the data on that account was removed and the account was reset to a brand new, empty one. The researcher found it while taking part in a bug bounty programme run by the U.S. Department of Defence, on a site that was in scope for that programme. The bug was given the identifier CVE-2022-35863, and this was the researcher's first CVE.

A CVE, short for Common Vulnerabilities and Exposures, is a public catalogue number for a known security flaw. Think of it like a reference number a manufacturer gives to a recalled product: it lets everyone talk about the same flaw and look it up later. Getting one assigned is a milestone for a researcher, because it means the flaw has been recognised and recorded.

A bug bounty programme is a scheme where an organisation invites people to test its systems and pays or credits them for reporting problems responsibly, instead of attacking it. "In scope" means the particular site or system the programme says you are allowed to test. Testing outside that list is not allowed.

The software in question was used across several private sectors, including military and government as well as healthcare. The researcher does not name the company or give exact proof of concept code, because at the time of writing the CVE was in the last stages of being assigned and the details were not yet public. The CVE ID itself is shared.

The affected feature is account registration: the form and behind-the-scenes request that creates a new account from details you submit, such as your email address, account details and password. Normally that request should refuse to act if the email address already belongs to an account. In this version it did not, and that is the whole bug.

The tools, explained from zero

Before the story, here is what each tool does, because the write-up assumes you know them.

  1. Burp Suite is a program that sits between your browser and a website. Every request your browser sends and every response the site sends back passes through it, and it keeps a record of all of them. That record is called the proxy history. Burp Suite also has a feature called Repeater, which lets you take one captured request and send it again and again, changing a small part each time, to see how the server reacts. Think of the proxy as a recording of every conversation you had with a website, and Repeater as a way to replay one sentence with a word changed.
  2. Kite Runner and other discovery tools are programs that automatically explore a website, following links and guessing at pages, to map out what exists. This activity is called recon (short for reconnaissance) and site crawling. The results were fed directly into the Burp Suite proxy, so every page the tools found was also recorded and could be tested.
  3. The target's client side application and its JavaScript files. A website is made of files your browser downloads and runs. JavaScript is the programming language those files are written in, and it often contains the addresses of the behind-the-scenes services the page talks to. Reading those files by hand is a way to find endpoints that are not linked anywhere visible on the site.

An endpoint is a specific address on a server that accepts a particular kind of request, like a counter in a shop that handles one type of transaction. A POST request is one of the ways a browser talks to a server: it carries data in the body of the request, typically used when you submit a form. A GET request, by contrast, asks for a page or resource and puts its details in the address itself. When the write-up says it filtered by "POST requests displaying parameters", it means it looked through the recorded history for requests that submit data, because those are the ones that create or change things on the server.

An API (Application Programming Interface) is the set of addresses and rules a program uses to talk to another program. In web terms, it is the behind-the-scenes part of a site that the visible pages call to fetch or change data. You never see it in the address bar, but your browser talks to it constantly.

A cookie or token is a small piece of data a site gives your browser after you log in, which your browser sends back with every later request so the site knows who you are. It works like a wristband at an event: show it at the door and you get in without proving who you are again. Many attacks aim at these, which is why the researcher was testing for them.

Two more terms appear in the story. CSRF (Cross-Site Request Forgery) is an attack where a malicious site tricks your browser into sending a request to another site where you are logged in, using your existing wristband without your knowledge. Testing for CSRF means checking whether a request can be made to succeed without any proof that it genuinely came from the site's own pages. IDOR (Insecure Direct Object Reference) is a flaw where a site lets you access someone else's data just by changing an identifier, such as a number in a request, without checking that the data belongs to you. Testing for IDORs means noting down the identifiers that belong to your own account and seeing whether other numbers work too.

Setting up

The researcher had been testing on example.com for a couple of weeks. By that point several vulnerabilities had already been reported, and as a result there was a huge Burp Suite file: a long recorded history of every request and response seen so far. The setup was:

  1. Burp Suite, used as the proxy and for Repeater.
  2. Kite Runner and other discovery tools, used for recon and site crawling, with the results fed directly into the Burp Suite Proxy.
  3. The target's client side application and its JavaScript files, read to find further endpoints.

The attack is unauthenticated: the attacker does not need an account or a login of their own.

Finding it

Before moving on from the target, the researcher wanted to make sure everything possible had been found. That is when the target tab was revisited and the history filtered by POST requests displaying parameters. The reasoning is simple: requests that submit data are the ones that create or change records, so they are where a flaw that changes records is most likely to hide.

After deep recon and site crawling, feeding the results directly to the Burp Suite Proxy, testing every endpoint available on the client side and also reading JavaScript files for further endpoints, a POST request with a weird API endpoint of the form blah/blah/DEFAULT stood out. Looking it over, it was the account registration URL, and it carried the email address, account details and password being registered.

Line by line: POST is the type of request, the kind that submits data to the server. blah/blah/DEFAULT is the path of the endpoint, shown here in a disguised form so the real product is not revealed; the word DEFAULT at the end is the part that looked unusual. The report does not show the headers or the body of this request, only that it contained the email address, account details and password.

The request was sent to Repeater and not thought much about at first. Then, while testing for CSRF, the request was tampered with by sending it with an already registered email address. The response came back 200 OK with an ID assigned to the account, and that was not the ID noted down for the account when testing IDORs. That looked wrong.

200 OK is the standard code a web server sends to mean "the request succeeded". An ID here is the internal number the application uses to identify an account. The researcher had already recorded the ID of their own account while testing IDORs, so seeing a different ID come back for the same email address was the clue: the server had not refused the duplicate, it had created something new.

Next, an attempt to log in again produced an error message saying, "Please confirm your email". The address had been confirmed earlier. Going back to the email inbox, confirming the account again, and logging in showed the account was blank and brand new. It had been wiped.

Exploitation, step by step

Step 1: Capture the registration request

While reviewing the POST requests with parameters in the Burp Suite file, the account registration request was identified. It pointed at an API endpoint of the form blah/blah/DEFAULT and contained the email address, account details and password for the account being registered. It was sent to Repeater.

Why this step: Repeater is where a single request can be replayed with small changes, which is exactly what is needed to test whether the server checks for duplicates.

Step 2: Replay it with an already registered email address

In Repeater the request was tampered with, sending it with an already registered email address while testing for CSRF. The server answered 200 OK and returned an ID assigned to the account. That ID was different from the one noted for the account during IDOR testing.

Why this step: if the server were doing its job, it would reject an email address that already has an account. A success response with a new ID shows it did not reject it, and that it did something to the account instead.

Step 3: Observe the effect on the account

When trying to log in again, the error "Please confirm your email" appeared, even though the address had been confirmed earlier. After confirming the account again through email and logging in, the account was blank and brand new. The original account had been wiped.

Why this step: the response code alone does not prove damage. Logging in afterwards shows what actually happened to the account, which is the difference between a suspicious response and a confirmed vulnerability.

Step 4: Confirm with a second address

Going back to the request, another test email address was entered on the same API endpoint. That account was wiped as well.

Why this step: repeating the test on a different account rules out a one-off glitch and shows the behaviour is consistent.

Step 5: Enumerate accounts first (optional stage)

There was also, conveniently, an API endpoint that validated existing email addresses. That endpoint could be used as stage 1 of the attack, to enumerate active accounts before wiping them.

To enumerate means to work through a list and find out which entries are valid. Here, the validation endpoint answers the question "does an account exist for this email address?", which lets an attacker build a list of real accounts to target. It is like a shop assistant who will tell anyone whether a given name is on the customer list, which makes it much easier to pick names worth trying.

Root cause

The API endpoint was not validating whether accounts were already registered. It simply assigned new IDs to the email address that was input, which meant that anyone's account could be wiped. The new ID overwrote the existing record, so all data held on the application for that account was removed.

"Trusting the client" is a common root cause: the server assumes the browser will only send sensible data, and never checks for itself. A useful comparison is a form that asks you to tick a box promising you are over 18. The promise is made on your side, so anyone can make it regardless of the truth. The server should always check for itself.

Impact

The CVE proves that any user's account, even an administrator's, can be completely wiped and reset, with all data held on the application for that account removed, because the new ID overwrote it. The attack is unauthenticated and remote: no login is needed and it can be carried out over the network from anywhere.

After analysing the technology in use on the site and at the software company, the researcher identified that this affected all of their sites running this version, which was the latest. In other words, the flaw was not specific to the one site tested; it was in the shared software, so every installation of that version carried it.

Fix

In plain terms: before doing anything, the server should look up the email address, and if an account already exists, stop and return an error. It should never overwrite an existing record just because a request arrived asking it to.

Variants to test

If you want to look for the same kind of flaw yourself, these are the checks the write-up suggests. Each one is a way of asking the same question: does the server check for itself before changing a record?

  1. Replay a registration request with an email address that is already registered. A positive result is a 200 OK carrying a new account ID that differs from the one you recorded for that account.
  2. After the replay, attempt to log in with the original credentials. A positive result is a "please confirm your email" style error or a login into an empty, freshly created account.
  3. Look for a separate endpoint that validates whether an email address exists, and use it to enumerate active accounts before testing the registration endpoint against them.
  4. Filter your proxy history by POST requests with parameters and inspect the registration endpoint, such as blah/blah/DEFAULT, for the same missing existence check.
  5. Read JavaScript files for further endpoints, as was done here.

Glossary

  • API: the set of behind-the-scenes addresses and rules one program uses to talk to another; in a website, the part the visible pages call to fetch or change data.
  • Account registration: the feature that creates a new account from details you submit, such as email address, account details and password.
  • Authentication: proving who you are, usually by logging in. An unauthenticated attack needs no login of the attacker's own.
  • Bug bounty programme: a scheme where an organisation invites people to test its systems and rewards them for reporting problems responsibly.
  • Burp Suite: a tool that sits between your browser and a website, records every request and response, and lets you replay and modify them.
  • Client side: the part of a website that runs in your browser, as opposed to the server side, which runs on the organisation's machines.
  • Cookie / token: a small piece of data a site gives your browser after login, sent back with later requests so the site knows who you are.
  • CSRF (Cross-Site Request Forgery): an attack that tricks your browser into sending a request to a site where you are logged in, using your existing session without your knowledge.
  • CVE (Common Vulnerabilities and Exposures): a public catalogue number assigned to a known security flaw so it can be referenced and looked up.
  • Endpoint: a specific address on a server that accepts a particular kind of request.
  • Enumerate: to work through a list and find out which entries are valid, for example which email addresses have accounts.
  • GET request: a request that asks for a page or resource, with its details in the address itself.
  • ID: an internal number an application uses to identify a record, such as an account.
  • IDOR (Insecure Direct Object Reference): a flaw where changing an identifier in a request lets you reach someone else's data because the server does not check that it belongs to you.
  • In scope: the particular systems a bug bounty programme says you are allowed to test.
  • JavaScript: the programming language that website files are written in and that your browser runs; those files often reveal the addresses of endpoints.
  • Kite Runner: one of the discovery tools used for recon and site crawling, with results fed into the Burp Suite proxy.
  • POST request: a request that carries data in its body, typically used when submitting a form or creating a record.
  • Proxy: an intermediary that sits between your browser and a website and records the traffic passing through it.
  • Recon (reconnaissance): the mapping-out of what exists on a target, by crawling, guessing and reading files.
  • Remote: carried out over the network from somewhere else, rather than needing physical access.
  • Repeater: a Burp Suite feature that lets you take one captured request and send it again and again with small changes.
  • Root cause: the underlying reason a flaw exists, as opposed to its visible symptom.
  • Site crawling: automatically following links and guessing at pages to map out a website.
  • 200 OK: the standard response code meaning the server handled the request successfully.
  • Trusting the client: a mistake where the server assumes the browser will only send sensible data and never checks for itself.

More by Tobydavenn

View all

11 more disclosed reports, best first.

More from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.