Skip to content
Business logic Disclosed report Intermediate

Integer overflow vulnerability

The report claims an integer overflow flaw in a cash-on-delivery checkout flow that lets an attacker change the quantity value at the last moment, which the author says leads to price manipulation. The text does not show the actual request or response, so the exact mechanism and whether the price really changes are not demonstrated.

0f1c3r Follow

Originally disclosed on HackerOne

Critical 9.3 View original
  • Triaged in 4 days
  • Fixed in 10 days
  • Disclosed after 10 days

Summary:

In one of my previous reports i send parameter tampering report vulnerability. Then you asked me to send PoC and you just closed it, that's why i'm sending you this new report with exactly name of vulnerability. Integer Overflows are closely related to other conditions that occur when manipulating integers. An Integer Overflow is the condition that occurs when the result of an arithmetic operation, such as multiplication or addition, exceeds the maximum size of the integer type used to store it. When an integer overflow occurs, the interpreted value will appear to have “wrapped around” the maximum value and started again at the minimum value. For example, an 8-bit signed integer on most common computer architectures has a maximum value of 127 and a minimum value of -128. If a programmer stores the value 127 in such a variable and adds 1 to it, the result should be 128. However, this value exceeds the maximum for this integer type, so the interpreted value will “wrap around” and become -128.

Attackers can use these conditions to influence the value of variables in ways that the programmer did not intend. The security impact depends on the actions taken based on those variables. Examples include, but are certainly not limited, to the following:

An integer overflow during a buffer length calculation can result in allocating a buffer that is too small to hold the data to be copied into it. A buffer overflow can result when the data is copied.

When calculating a purchase order total, an integer overflow could allow the total to shift from a positive value to a negative one. This would, in effect, give money to the customer in addition to their purchases, when the transaction is completed.

Withdrawing 1 dollar from an account with a balance of 0 could cause an integer underflow and yield a new balance of 4,294,967,295.

A very large positive number in a bank transfer could be cast as a signed integer by a back-end system. In such case, the interpreted value could become a negative number and reverse the flow of money - from a victim's account into the attacker's.

Steps To Reproduce:

Beside card payment, you have option "cache on delivery" and there i found one mistake which gives me possibility to change price in last moment.. The moment when you actually should change quantity value is:

Supporting Material/References:

[list any additional material (e.g. screenshots, logs, etc.)]

  • [attachment / reference]

Impact

Integer overflow, quantity value manipulation leads to price manipulation..

Attachments

Screenshot_(150).png
Screenshot_(150).png From the original on HackerOne
Screenshot_(149).png
Screenshot_(149).png

The original report as published on HackerOne, by 0f1c3r. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

Context

The target is Glovo, a delivery platform, and the asset in scope is *.glovoapp.com. The feature involved is checkout payment: alongside card payment, the platform offers a cash on delivery option. The report is filed as an integer overflow issue with a CVSS score of 9.3 (critical), disclosed on 17 May 2022 by researcher 0f1c3r.

The report opens with a note on history. The researcher had previously submitted a parameter tampering report on the same behaviour. The triage team asked for a proof of concept and then closed that report. This new submission repeats the finding under the exact name of the vulnerability class, integer overflow.

Setup

The report does not describe accounts, roles, tools or versions. What it does establish is the precondition: the cash on delivery payment option must be available at checkout, and the attacker must be able to reach the point in the order flow where the quantity value is submitted.

Finding it

The researcher describes the issue in one sentence: beside card payment there is a cash on delivery option, and there the researcher found a mistake that allows the price to be changed at the last moment. The report does not name the endpoint, the parameter or the request that carries the quantity.

The report then explains the vulnerability class in general terms. An integer overflow is the condition that occurs when the result of an arithmetic operation, such as multiplication or addition, exceeds the maximum size of the integer type used to store it. When that happens, the interpreted value appears to have wrapped around the maximum value and started again at the minimum value. The report gives the standard example: an 8-bit signed integer has a maximum of 127 and a minimum of -128 on most common architectures, so storing 127 and adding 1 yields -128 rather than 128.

The report lists the ways attackers can abuse these conditions to influence variables in ways the programmer did not intend, with the security impact depending on what the application does with those variables:

  1. An integer overflow during a buffer length calculation can allocate a buffer too small for the data copied into it, producing a buffer overflow when the copy happens.
  2. When calculating a purchase order total, an overflow could shift the total from a positive value to a negative one, effectively giving money to the customer in addition to their purchases when the transaction completes.
  3. Withdrawing 1 dollar from an account with a balance of 0 could cause an integer underflow and yield a new balance of 4,294,967,295.
  4. A very large positive number in a bank transfer could be cast as a signed integer by a back-end system, making the interpreted value negative and reversing the flow of money from a victim's account into the attacker's.

The second example, the purchase order total, is the one that matches the checkout scenario described here.

Exploitation

Step 1: choose cash on delivery at checkout

At checkout, next to card payment, the cash on delivery option is available. The report says the mistake was found in the cash on delivery option.

Step 2: change the quantity value at the last moment

The report says the moment when the quantity value should be changed is not spelled out in the text. The report does not include the request, the parameter name or the value used; the only evidence of the step is the screenshots in the attachments.

Screenshot_(150).png
Screenshot_(150).png From the original on HackerOne
Screenshot_(149).png
Screenshot_(149).png

The report includes two attachments but does not describe them. The text does not describe what each one shows beyond the step above, so the exact request and response are not reproduced here.

Step 3: observe the price change

The result, as stated in the impact section, is quantity value manipulation that leads to price manipulation.

Root cause

The report labels the issue an integer overflow and says quantity manipulation leads to price manipulation.

Impact

An attacker can manipulate the quantity value and, through it, the price of an order paid with cash on delivery. The report's own summary of the impact is: integer overflow, quantity value manipulation leads to price manipulation. The report does not quantify the loss per order or describe any limit on how far the price can be moved.

Fix

Based on the finding, the quantity should be validated server-side at the final step of the order flow, with bounds on the accepted range and a recalculation of the total that does not trust client-supplied values.

Variants to test

  1. Submit a quantity at the final checkout step that differs from the quantity in the cart, on any payment method, not only cash on delivery. A positive result is an order total that reflects the submitted quantity rather than the cart quantity.
  2. Submit very large quantity values to look for wrap-around in the total. A positive result is a total that becomes negative or restarts at a small value.
  3. Submit negative or zero quantities. A positive result is a credit, a zero total, or an order accepted with an impossible quantity.
  4. Repeat the last-moment change on other order types or delivery options that recalculate price from quantity. A positive result is any price that differs from the price shown before the final step.

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

What happened, in plain words

Glovo is a delivery platform: you use an app or a website to order food or other goods, and someone brings them to you. The part of the platform involved here is the checkout, the screen where you confirm your order and choose how to pay. Normally you pay by card. Glovo also offers a second option, paying in cash when the order arrives (the report calls it "cache on delivery", meaning cash on delivery).

The researcher found that in the cash on delivery flow the price can be changed at the last moment, and describes this as quantity value manipulation leading to price manipulation. The report files this under a class of bug called an integer overflow, and the platform rated it critical with a CVSS score of 9.3. It was disclosed on 17 May 2022 by the researcher 0f1c3r, and the asset in scope is *.glovoapp.com, meaning any subdomain of the glovoapp.com domain.

One piece of history matters. The researcher had already sent a report about the same behaviour, described as parameter tampering. The triage team (the people who read incoming reports and decide whether they are valid) asked for a proof of concept, then closed that report. A proof of concept, usually shortened to PoC, is a small demonstration that shows the bug actually happening, rather than just describing it. This new report resubmits the same finding under the exact name of the vulnerability class, integer overflow.

A few words you will meet throughout, explained once here:

  • An endpoint is a specific address on a server that does one job, like a counter in a shop. When your browser or app sends a request to that address, the server performs an action and sends something back.
  • An API (application programming interface) is the set of these addresses and the rules for talking to them. Think of a restaurant: the menu and the waiter are the API, the kitchen is the server. You do not walk into the kitchen yourself; you ask through the waiter.
  • A parameter is one named piece of information in a request, such as the quantity of an item. It is like a field on a paper form: the field has a name (quantity) and you write a value in it (3).
  • Parameter tampering means changing such a value before it reaches the server, hoping the server trusts whatever you send.
  • A cookie is a small piece of data your browser stores for a website and sends back with each request, often used to remember who you are. A token is similar: a string that proves you are logged in. Both are secrets; if someone else gets them, they can act as you.

Setup

The report does not describe accounts, roles, tools or software versions. What it does establish is the precondition: the cash on delivery payment option has to be available at checkout, and the attacker has to be able to reach the point in the order flow where the quantity value is submitted. In plain terms, you need to be a normal customer who has got as far as the payment step of an order.

Finding it

The researcher describes the issue in a single sentence: beside card payment there is a cash on delivery option, and there the researcher found a mistake that allows the price to be changed at the last moment. The report does not name the endpoint, the parameter or the request that carries the quantity, so we cannot show the exact traffic here.

The report then explains the vulnerability class in general terms, and it is worth following that explanation from zero. Computers store whole numbers (integers) in fixed-size boxes. Each box has a maximum value it can hold. An integer overflow is what happens when the result of an arithmetic operation, such as multiplication or addition, is bigger than the biggest value the box can store. The stored value then appears to have wrapped around: it jumps from the maximum back to the minimum and carries on from there.

The report gives the standard example. An 8-bit signed integer, on most common computer architectures, has a maximum value of 127 and a minimum value of -128. If a programmer stores 127 in such a variable and adds 1, the true answer is 128, but 128 does not fit in the box. So the interpreted value wraps around and becomes -128. A good everyday comparison is a car odometer with a fixed number of digits: drive past the highest number it can show and it rolls over to zero and starts counting again. The number on display is no longer the true distance.

The report then lists the ways attackers can use these conditions to influence the value of variables in ways the programmer did not intend. The security impact depends on what the application does with those variables. The examples given are:

  1. An integer overflow during a buffer length calculation can result in allocating a buffer that is too small to hold the data to be copied into it. A buffer overflow can result when the data is copied. (A buffer is a reserved area of memory used to hold data temporarily; if it is sized wrongly, data spills past its end.)
  2. When calculating a purchase order total, an integer overflow could allow the total to shift from a positive value to a negative one. This would, in effect, give money to the customer in addition to their purchases, when the transaction is completed.
  3. Withdrawing 1 dollar from an account with a balance of 0 could cause an integer underflow and yield a new balance of 4,294,967,295. (An underflow is the same idea in the other direction: going below the smallest value the box can hold and wrapping around to the top.)
  4. A very large positive number in a bank transfer could be cast as a signed integer by a back-end system. In such a case, the interpreted value could become a negative number and reverse the flow of money, from a victim's account into the attacker's. (Casting means converting a value from one type to another, for example from an unsigned number, which cannot be negative, to a signed one, which can.)

Of these four, the second one, the purchase order total, is the one that matches the checkout scenario described in this report.

Exploitation

Step 1: choose cash on delivery at checkout

At checkout, next to card payment, the cash on delivery option is available. The researcher selects it, because the manipulation happens in that flow.

Step 2: change the quantity value at the last moment

The report states that the moment when the quantity value should actually be changed is the point shown in the supporting material. The report does not include the request, the parameter name or the value used. The only evidence of this step is the screenshots in the attachments.

Screenshot_(150).png
Screenshot_(150).png From the original on HackerOne
Screenshot_(149).png
Screenshot_(149).png

The report includes two attachments but does not describe them. The text does not describe what each one shows beyond the step above, so the exact request and response are not reproduced here.

Step 3: observe the price change

The result, as stated in the impact section, is quantity value manipulation that leads to price manipulation.

Root cause

The report labels the issue an integer overflow and says quantity manipulation leads to price manipulation.

Impact

An attacker can manipulate the quantity value and, through it, the price of an order paid with cash on delivery. The report's own summary of the impact is: integer overflow, quantity value manipulation leads to price manipulation. The report does not quantify the loss per order or describe any limit on how far the price can be moved.

Fix

Based on the finding, the quantity should be validated on the server at the final step of the order flow, with limits on the accepted range, and the total should be recalculated in a way that does not trust values supplied by the client (the browser or app on the customer's side).

Variants to test

These are follow-up ideas suggested by the finding, not things the report says were tested:

  1. Submit a quantity at the final checkout step that differs from the quantity in the cart, on any payment method, not only cash on delivery. A positive result is an order total that reflects the submitted quantity rather than the cart quantity.
  2. Submit very large quantity values to look for wrap-around in the total. A positive result is a total that becomes negative or restarts at a small value.
  3. Submit negative or zero quantities. A positive result is a credit, a zero total, or an order accepted with an impossible quantity.
  4. Repeat the last-moment change on other order types or delivery options that recalculate price from quantity. A positive result is any price that differs from the price shown before the final step.

Glossary

  • API: the set of addresses and rules a program uses to talk to a server, like a menu and waiter in a restaurant.
  • Asset: the thing being tested, here *.glovoapp.com, meaning any subdomain of glovoapp.com.
  • Buffer: a reserved area of memory used to hold data temporarily.
  • Buffer overflow: writing more data into a buffer than it can hold, so the data spills past its end.
  • Cash on delivery: paying in cash when the order arrives, instead of by card at checkout.
  • Casting: converting a value from one data type to another, for example from an unsigned number to a signed one.
  • Checkout: the final part of an order where you confirm items and choose how to pay.
  • Cookie: a small piece of data a website stores in your browser and receives back with each request, often to remember who you are.
  • Critical: the highest severity rating, meaning the bug should be fixed urgently.
  • CVSS: a standard scoring system for the severity of a security bug; 9.3 is in the critical range.
  • Endpoint: a specific address on a server that performs one job.
  • Integer: a whole number, with no fractional part.
  • Integer overflow: what happens when the result of an arithmetic operation is too big for the fixed-size box used to store it, so the value wraps around to the minimum.
  • Integer underflow: the same idea in the other direction, going below the smallest value and wrapping around to the maximum.
  • Parameter: one named piece of information in a request, such as a quantity value.
  • Parameter tampering: changing a parameter's value before it reaches the server, hoping the server trusts it.
  • Proof of concept (PoC): a small demonstration that shows a bug actually happening.
  • Signed integer: a whole number that can be negative as well as positive.
  • Token: a string that proves you are logged in, similar in role to a cookie.
  • Triage: the process of reading incoming bug reports and deciding whether they are valid.
  • Unsigned integer: a whole number that cannot be negative.
  • Variable: a named storage slot in a program that holds a value.
  • Wrap-around: the jump from the maximum value of a number box back to its minimum, or the reverse.

More from Glovo

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.