Device Authorization Bypass!
A device-authorisation step that asked a secret security question could be skipped by removing the answer field from the JSON request body. An attacker with valid credentials could then log in from an untrusted device without answering the question.
Published on medium.com
{{media:0}}
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
About two months before writing this up, Hassan Khan Yusufzai received a private invitation on BugCrowd. For the sake of the private programme's privacy he refers to the target throughout as Private.com.
The feature that matters here is device authorisation. When a user logs in from a trusted device, the application does not prompt for a secret security question. When the same user logs in from an untrusted or new device, the application redirects them to Private.com/device-authorization, where the security question is meant to be answered before access is granted.

Setup
The work was done against a private BugCrowd programme, so no hostnames, account details or programme name are given. The researcher was pen-testing the application as a logged-in user and observing the login flow from a new device. The requests are shown as raw HTTP with a Cookie header that has been snipped out.
Finding it
The device-authorisation step caught his attention because it is the extra check applied to new devices. He first looked for common ways around it, including rate-limit tricks, but the application had rate-limit protection in place. He tested the application for a whole day without finding a way past device authentication, became fed up, left the target and started hunting other sites.

Two days later he came back to Private.com for another shot. This time he looked at the POST request that submits the security answer and asked himself why not try removing the parameter and its value.
Exploitation
Step 1: capture the device-authorisation POST
The request that the browser sends when submitting the security answer looked like this:
POST /device-authorization HTTP/1.1
Host: private.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/json;charset=utf-8
X-Requested-With: XMLHttpRequest
Referer: https://www.private.com/device-authorization
Content-Length: 57
Cookie: SNIP
Connection: close
{"deviceAuth[remember]":true,"deviceAuth[answer]":"test"}
The body is JSON with two fields: deviceAuth[remember], set to true, and deviceAuth[answer], which carries the answer to the secret security question. The X-Requested-With: XMLHttpRequest header shows the call is made by the page's own JavaScript, and the Referer points back at the device-authorisation page. The session cookie is redacted in the report.
Step 2: remove the answer parameter
He removed "deviceAuth[answer]":"test" from the POST data and sent the request with only:
{"deviceAuth[remember]":true}
So the request no longer contains any answer to the security question at all; only the remember flag remains.
Step 3: read the response
The server accepted the request and returned:
HTTP/1.1 200 OK
Date: Mon, 25 Sep 2017 20:52:59 GMT
Content-Type: application/json
Content-Length: 47
Connection: close
Cache-Control: no-cache
X-Frame-Options: SAMEORIGIN
Set-Cookie:
Set-Cookie:
X-NewRelic-App-Data:
Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
X-Content-Type-Options: nosniff
{"Success":true}
The body is {"Success":true}, and the browser was then redirected to the /settings page of his profile. The two Set-Cookie headers are present in the response but their values are not shown in the report.

In short, by removing the parameter and its value he was able to bypass device authorisation and reach the authenticated settings page from an untrusted device without ever answering the security question.
Root cause
The report does not describe the server-side code, so the exact mistake is not stated. What the behaviour shows is that the endpoint treats the absence of deviceAuth[answer] as acceptable rather than as a failed check: the request is processed, {"Success":true} is returned and the session is moved past the device-authorisation step. Likely the handler validates the answer only when the field is present, or checks a condition that a missing field silently satisfies, instead of requiring the answer and rejecting the request when it is absent.
Impact
By removing the answer parameter, the researcher's session moved past the security question and was redirected to the /settings page of his profile. The security question is the additional check the application applies for new devices, and the bypass removed it for the session tested. The report does not go further into what else the session could reach beyond /settings.
Fix
The report says the issue was fixed within a day. The analyst's reply was:
Nice find!
Thank you for reporting this vulnerability to us and provide with very detailed report. We have applied a fix, can you help verify if the issue has been resolved, so we can move the ticket to closed. Thank you very much!
The report does not describe what the fix changed. The analyst asked the researcher to help verify that the issue had been resolved.
Variants to test
- Remove the answer field from the JSON body and resend the device-authorisation POST. A positive result is a success response and a redirect to an authenticated page instead of an error or a return to the challenge.
- Remove other fields one at a time, such as the remember flag, and observe whether the endpoint still accepts the request. A positive result is any response that advances the session without the removed field being validated.
- Send the request with an empty or null answer value rather than omitting the field. A positive result is the same success response, showing the check is not enforced on the value either.
- Try the same omission on other multi-step flows that submit a JSON body, such as password reset or MFA verification. A positive result is a step being skipped when its parameter is absent.
- As the author's own tip puts it, don't forget to append and remove parameters to bypass things.
What happened, in plain words
A security researcher found a way to skip a security check on a website. The site asked for a secret answer when you logged in from a new device, and he discovered that if he simply deleted the answer from the request his browser sent, the site let him through anyway. He reported it, and the company fixed it within a day.
This article walks through the whole story slowly, explaining every term as it comes up, so you can follow it even if you have never done security testing before.
Background: what the site was and what it did
About two months before writing this up, Hassan Khan Yusufzai received a private invitation on BugCrowd. BugCrowd is a platform where companies invite security researchers to test their systems and pay them for finding problems. A private invitation means only selected researchers are allowed to look at that particular target. For the sake of the private programme's privacy he refers to the target throughout as Private.com.

The feature that matters here is device authorisation. Let us unpack that.
Many websites try to tell one computer apart from another. When you log in, the site can remember that this particular browser has been used before and is therefore trusted. When you log in from a computer or phone the site has not seen before, it is untrusted, or new. Banks and email providers often add an extra step for new devices, such as a secret question, a code sent by text message, or an email confirmation. The idea is that even if someone steals your password, they still cannot get in from their own machine without passing that extra step.
On Private.com, the behaviour was:
- When a user logs in from a trusted device, the application does not prompt for a secret security question.
- When the same user logs in from an untrusted or new device, the application redirects them to
Private.com/device-authorization, where the security question is meant to be answered before access is granted.
A redirect is simply the site telling your browser "go to this other page instead". So a new device gets sent to a page whose whole job is to collect the secret answer.
That page is where the secret answer is meant to be given before access is granted. If you can get past it without answering, the extra protection is worthless.
Setting up
The work was done against a private BugCrowd programme, so no hostnames, account details or programme name are given. The researcher was pen-testing the application as a logged-in user and observing the login flow from a new device.
Pen-testing means testing a system the way an attacker would, but with permission. The requests are shown as raw HTTP, which is the plain-text format browsers and servers use to talk to each other. A proxy sits between your browser and the website and lets you see, pause and edit the messages going back and forth. Think of it like a postal worker who lets you open each letter before it is delivered, change the wording, and seal it again. The requests in this article are shown as raw HTTP, which is the plain-text format browsers and servers use to talk to each other. The Cookie header has been snipped out, meaning the researcher removed it before publishing so nobody could use his login session.
Finding it
He first looked for common ways around the device-authorisation step, including rate-limit tricks. A rate limit is a cap on how many requests you can send in a period of time, for example ten attempts per minute. Attackers often try to guess a secret answer by trying thousands of possibilities quickly, and a rate limit is meant to stop that. The application had rate-limit protection in place.
He tested the application for a whole day without finding a way past device authentication, became fed up, left the target and started hunting other sites.

Two days later he came back to Private.com for another shot. This time he looked at the POST request that submits the security answer and asked himself why not try removing the parameter and its value.
A POST request is one of the ways a browser sends information to a server. When you fill in a form and press a button, your browser usually sends a POST request carrying what you typed. A parameter is a named piece of data inside that request, like a labelled box on a form: one box might be called answer and contain what you typed. The value is what is inside the box. So his idea was: what if I send the form with the answer box missing entirely?
Exploitation
Step 1: capture the device-authorisation POST
The request that the browser sends when submitting the security answer looked like this:
POST /device-authorization HTTP/1.1
Host: private.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/json;charset=utf-8
X-Requested-With: XMLHttpRequest
Referer: https://www.private.com/device-authorization
Content-Length: 57
Cookie: SNIP
Connection: close
{"deviceAuth[remember]":true,"deviceAuth[answer]":"test"}
Line by line, in plain words:
POST /device-authorization HTTP/1.1says "I am sending data to the page called /device-authorization, using version 1.1 of the HTTP protocol".Host: private.comnames the website being contacted. One server can host many sites, so the server needs to know which one you want.User-Agent: ...Firefox/55.0tells the server which browser and operating system sent the request. Here it is Firefox 55 on 64-bit Windows 10.Accept: application/json, text/plain, */*says which kinds of response the browser can handle. JSON is a simple text format for structured data, made of names and values in curly brackets, and it is the format used throughout this story.Accept-Language: en-US,en;q=0.5says the browser prefers English.Accept-Encoding: gzip, deflate, brsays the browser can accept compressed responses to save bandwidth.Content-Type: application/json;charset=utf-8announces that the body of the request is JSON text.X-Requested-With: XMLHttpRequestis a marker showing the request was made by JavaScript running inside the page, rather than by you clicking a normal link. JavaScript is the programming language that makes web pages interactive.Referer: https://www.private.com/device-authorizationtells the server which page the request came from.Content-Length: 57says the body is 57 bytes long.Cookie: SNIPis where the browser would send its cookie. A cookie is a small piece of data the site stored in your browser earlier, usually after you logged in, and the browser sends it back with every request so the server knows who you are. Think of it as a wristband you get at an event: you show it at the door and you are let in without showing your ticket again. The value here has been replaced withSNIPto keep the session private.Connection: closeasks the server to close the connection after this exchange.- The blank line separates the headers from the body.
{"deviceAuth[remember]":true,"deviceAuth[answer]":"test"}is the body: JSON with two fields.deviceAuth[remember]is set totrue, which presumably means "remember this device as trusted".deviceAuth[answer]carries the answer to the secret security question, here the placeholdertest.
Step 2: remove the answer parameter
He removed "deviceAuth[answer]":"test" from the POST data and sent the request with only:
{"deviceAuth[remember]":true}
This is the same JSON as before with one field deleted. The request no longer contains any answer to the security question at all; only the remember flag remains. The reasoning behind the step is simple: if the server checks the answer only when it is there, then taking it away might make the check disappear rather than fail.
Step 3: read the response
The server accepted the request and returned:
HTTP/1.1 200 OK
Date: Mon, 25 Sep 2017 20:52:59 GMT
Content-Type: application/json
Content-Length: 47
Connection: close
Cache-Control: no-cache
X-Frame-Options: SAMEORIGIN
Set-Cookie:
Set-Cookie:
X-NewRelic-App-Data:
Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
X-Content-Type-Options: nosniff
{"Success":true}
Again line by line:
HTTP/1.1 200 OKis the status line.200is the standard code for "everything went fine". A failed security check would normally produce a different code, such as401or403, meaning not allowed.Date: Mon, 25 Sep 2017 20:52:59 GMTis when the server answered.Content-Type: application/jsonsays the response body is JSON.Content-Length: 47says the body is 47 bytes long.Connection: closemeans the server will close the connection after this.Cache-Control: no-cachetells browsers and proxies not to store this response for reuse.X-Frame-Options: SAMEORIGINstops other websites from embedding this page inside a frame, a defence against a trick called clickjacking.- The two
Set-Cookie:lines are where the server hands the browser new cookies. Their values are not shown in the report. X-NewRelic-App-Data:is a header added by New Relic, a service companies use to monitor how their applications perform.Strict-Transport-Security: max-age=15552000; includeSubDomains; preloadtells the browser to always use the encrypted HTTPS version of the site for the next 15552000 seconds, which is about 180 days, including subdomains.X-Content-Type-Options: nosniffstops the browser from guessing that a file is a different type than the server declared, which closes off some attacks.- The body is
{"Success":true}: the server says the operation succeeded.
The browser was then redirected to the /settings page of his profile. In other words, the site treated the new device as authorised and let him into the account settings, even though no security question had been answered.

In short, by removing the parameter and its value he was able to bypass device authorisation and reach the authenticated settings page from an untrusted device without ever answering the security question.
This kind of flaw is a broken authorisation problem: the site has a rule about who may proceed, and the rule can be sidestepped. The bypass worked because the server was willing to process a request that was missing the very field the check was supposed to examine.
Root cause
The report does not describe the server-side code, so the exact mistake is not stated. What the behaviour shows is that the endpoint treats the absence of deviceAuth[answer] as acceptable rather than as a failed check: the request is processed, {"Success":true} is returned and the session is moved past the device-authorisation step. Likely the handler validates the answer only when the field is present, or checks a condition that a missing field silently satisfies, instead of requiring the answer and rejecting the request when it is absent.
A useful everyday comparison: imagine a bouncer with a list of rules. One rule says "if a guest hands you a ticket, check that the ticket is valid". A guest with no ticket at all never triggers the check, so the bouncer waves them through. The rule should have been "every guest must show a valid ticket", with no ticket meaning no entry.
Rate limits slow down repetition; they do not help when one request is enough.
Impact
By removing the answer parameter, the researcher's session moved past the security question and was redirected to the /settings page of his profile. Credentials means the username and password. The security question is the additional check the application applies for new devices, and the bypass removed it for the session tested. The report does not go further into what else the session could reach beyond /settings.
Fix
The report says the issue was fixed within a day. The analyst's reply was:
Nice find!
Thank you for reporting this vulnerability to us and provide with very detailed report. We have applied a fix, can you help verify if the issue has been resolved, so we can move the ticket to closed. Thank you very much!
An analyst here is the person on the company's security team who reads incoming reports and coordinates the response. A ticket is the internal record of the issue, which stays open until the fix is confirmed.
The report does not describe what the fix changed. The analyst asked the researcher to help verify that the issue had been resolved.
Variants to test
Once you know the shape of a bug, it is worth asking where else the same shape might appear. These are variations on the same idea:
- Remove the answer field from the JSON body and resend the device-authorisation POST. A positive result is a success response and a redirect to an authenticated page instead of an error or a return to the challenge.
- Remove other fields one at a time, such as the remember flag, and observe whether the endpoint still accepts the request. A positive result is any response that advances the session without the removed field being validated.
- Send the request with an empty or null answer value rather than omitting the field. A positive result is the same success response, showing the check is not enforced on the value either.
- Try the same omission on other multi-step flows that submit a JSON body, such as password reset or MFA verification. MFA means multi-factor authentication, where a login needs more than one proof of identity, such as a password plus a code. A positive result is a step being skipped when its parameter is absent.
- As the author's own tip puts it, don't forget to append and remove parameters to bypass things. A state-changing request is one that alters something on the account, such as a setting or a password.
Glossary
- API: a way for one piece of software to talk to another, usually by sending structured requests and receiving structured responses.
- Analyst: the person on a company's security team who reviews vulnerability reports and coordinates fixes.
- Body: the part of an HTTP request or response that carries the actual data, after the headers.
- Broken authorisation: a flaw where a system fails to properly enforce who is allowed to do what, so a rule can be skipped or sidestepped.
- Brute force: trying many guesses quickly, such as thousands of possible answers, until one works.
- Bug bounty: a programme that pays researchers for responsibly reporting security problems.
- BugCrowd: a platform that hosts bug bounty programmes and connects companies with researchers.
- Clickjacking: a trick where an attacker embeds a real site inside an invisible frame to make you click things you did not intend to.
- Cookie: a small piece of data a site stores in your browser, often used to remember that you are logged in.
- Credentials: the username and password (or similar) used to log in.
- Device authorisation: an extra check a site applies when you log in from a device it does not recognise, such as a secret question or a code.
- Endpoint: a specific address on a server that accepts requests, such as
/device-authorization. - Header: a labelled line in an HTTP request or response carrying information about it, such as the browser type or content format.
- HTTP: the plain-text protocol browsers and servers use to exchange requests and responses.
- HTTPS: HTTP wrapped in encryption so others on the network cannot read or alter it.
- Impact: the harm an attacker could cause by exploiting a flaw.
- Intercepting proxy: a tool that sits between your browser and a site so you can view, pause and edit the traffic.
- JavaScript: the programming language that makes web pages interactive and lets them send requests in the background.
- JSON: a simple text format for structured data, made of names and values in curly brackets.
- MFA: multi-factor authentication, requiring more than one proof of identity at login, such as a password plus a code.
- New Relic: a service companies use to monitor the performance of their applications.
- Parameter: a named piece of data in a request, like a labelled box on a form.
- Pen-testing: testing a system the way an attacker would, with permission.
- POST request: an HTTP request that sends data to a server, typically when you submit a form.
- Rate limit: a cap on how many requests can be sent in a period of time.
- Redirect: the server telling the browser to go to a different page instead.
- Referer: a header telling the server which page the request came from.
- Root cause: the underlying mistake in the code or design that makes a flaw possible.
- Security question: a secret question whose answer is meant to prove your identity, used as an extra check.
- Session: the period during which a site remembers you as logged in, usually tracked with a cookie.
- State-changing request: a request that alters something on the account, such as a setting or a password.
- Status code: a number in an HTTP response saying how the request went, such as 200 for success or 403 for forbidden.
- Ticket: the internal record of an issue in a company's tracking system.
- User-Agent: a header telling the server which browser and operating system sent the request.
- Value: the content inside a named parameter.
- Vulnerability: a weakness in a system that an attacker could use to do something they should not be able to do.