Incorrect logic when buy one more license which may lead to extend the expire date of existing license
When a customer buys an additional licence, the existing licence's user count and expiry date are changed incorrectly, and the new licence's expiry date appears extended. An attacker could use this to extend the expiry date of an existing licence by buying a longer-dated one.
- Disclosed after 3 days
Hi Team,
I noticed a bug in the licenses which may lead to extend the expire date of existing license. To be honest, it is hard for me to reproduce it. I was plan to see if the license still works after ███████. I think it's better to report this issue to you althought it may prove it is just a display issue.
Background: when our company buy one more license with 5 years. Our existing license with 4 users will expire on ████. After we pay the money and got the new license. I revisit the following page and found something interesting. My existing license change from 4 users to 1 user, but the expire date is change to ███. ██████
- Make sure you have an existing license (in my case, we have a 4 users licenses which will expire on ██████████).
- Buy a new one user license with 5 years and pay it.
- After you receive the license, check it on the following page.
█████
Observer result:
- The existing license has change from 4 user to 1 user, but the expire date is █████████. I don't try to see if we can still use the left of the license because it will consume our licenses.
- The new license should expire at around ███████ but now it is ███. This means the new license expire date is extended.
You can track my accout to debug this issue. If you need any help from me. Please feel free to let me know. Thanks! ████
User can use this way to extend the existing license. For example, you can just buy one year and it will expire next year. Then buy one more license which will expire 10 years. Now you have two license both will expire 10 years.
Context
PortSwigger Web Security sells licences for its products through its own site, portswigger.net. A licence is tied to a number of users and to an expiry date. When a customer buys an additional licence, the site is expected to add the new entitlement alongside the existing one, leaving the original licence's user count and expiry date untouched.
The report describes a business logic error in that purchase flow: buying one more licence appeared to change the existing licence's user count and expiry date, and the new licence's expiry date appeared to be extended. The researcher is explicit that the behaviour was hard to reproduce and that it might turn out to be a display issue, but reports it because of the potential to extend an existing licence.
Setup
The researcher was acting as a customer of a company that already held a licence. The preconditions described are:
- An existing licence. In the researcher's case this was a licence for 4 users with a known expiry date.
- The ability to buy an additional licence through the normal purchase flow and pay for it.
- Access to the page where the customer's licences are listed after purchase.
No tools, versions or special configuration are mentioned. The researcher notes that reproducing the issue is difficult, and that they did not test whether the remaining time on the old licence could still be used, because doing so would consume licences.
Finding it
The researcher's original goal was to check whether the licence still worked after some event (the report redacts the detail). While doing that, they revisited the licence listing page after a purchase and noticed something unexpected.
The company had bought one more licence with a 5 year term. The existing licence covered 4 users and had a known expiry date. After payment and receipt of the new licence, the listing showed the existing licence changed from 4 users to 1 user, while its expiry date changed to a different value. The researcher describes this as interesting and worth reporting even if it proves to be only a display issue.
Exploitation
Step 1: Confirm the existing licence
Start from an existing licence. In the researcher's case this was a 4 user licence with a known expiry date.
Step 2: Buy an additional licence
Buy a new one user licence with a 5 year term and pay for it through the normal flow.
Step 3: Check the licence listing
After receiving the licence, check it on the licence page. The researcher's observations were:
- The existing licence changed from 4 users to 1 user, and its expiry date changed to a different value. The researcher did not test whether the remaining time on the old licence could still be used, because that would consume licences.
- The new licence should have expired at around a date consistent with its 5 year term, but the listing showed a different date. In the researcher's reading, this means the new licence's expiry date was extended.
The report does not include the page URL, the request or response bodies, or the exact dates; those values are redacted in the text.
Step 4: Generalise the abuse
The researcher's conclusion is that a user can use this behaviour to extend an existing licence. The example given: buy a one year licence, which expires next year, then buy one more licence that expires in 10 years. The result is two licences that both expire in 10 years.
Root cause
The report does not identify a code-level cause. What it describes is a logic problem in how the purchase of an additional licence is merged into the customer's existing licence record: The report does not identify a code-level cause. It describes only what the listing showed after the purchase: the old licence's user count and expiry date changed, and the new licence's expiry date appeared longer than its term. Whether this is a persistence bug or only a rendering bug in the listing is left open by the researcher, who says it may prove to be a display issue.. The report does not describe any validation or server-side check that should have prevented the merge.
Impact
Under the conditions described, a customer who buys an additional licence can end up with licences whose expiry dates are extended beyond what was paid for. The researcher's example is buying a short licence and then a long one so that both end up with the long expiry. The report hedges this: the researcher could not confirm whether the old licence's remaining time was still usable, and did not rule out that the effect is only in the display of the licence page. The report does not state a severity, a CVSS score or a bounty.
Fix
What the behaviour calls for is that the purchase of an additional licence creates or updates only the new entitlement, leaving the existing licence's user count and expiry date unchanged, and that the expiry date shown for each licence is derived from that licence's own term rather than from another licence on the account.
Variants to test
- Buy a short-term licence on an account that already holds a long-term licence and check whether the older licence's expiry date moves. A positive result is the old licence showing the new term.
- Buy a licence with a different user count and check whether the existing licence's user count is overwritten. A positive result is the old licence showing the new count.
- Repeat the purchase and check whether the effect compounds across multiple licences on the same account.
- Check whether the change is persisted, for example by reloading the page, logging out and back in, or querying the licence through any API the site exposes. A positive result is the extended date surviving a fresh session rather than appearing only once.
- Check whether the extended licence is actually usable, for example by activating it on a product, if doing so does not consume a licence you need.
Hunting notes
This kind of bug hides in purchase and entitlement flows where an account can hold more than one item of the same type: licence upgrades, seat additions, renewals and plan changes. The signal is a listing page that shows derived values, such as expiry dates and seat counts, that are computed from more than one record. When testing, record the state before the purchase, make the purchase, and compare each field of every existing item afterwards, not just the new one. The researcher described the before and after state of both licences and gave a concrete abuse example, while being clear about what had not been confirmed.
What happened, in plain words
PortSwigger Web Security sells licences for its products through its own website, portswigger.net. A licence is a permission to use a product. Two things describe a licence: how many users it covers, and the date it expires. If a company buys a licence for 4 users that runs until a certain date, that is what the company paid for.
When a customer buys an extra licence, you would expect the site to keep the old licence exactly as it was and simply add the new one next to it. The old licence should keep its 4 users and its original expiry date. The new licence should have its own user count and its own expiry date, based on the term that was bought.
The researcher found that this did not happen. After buying one more licence, the page that lists the customer's licences showed the old licence with a different user count and a different expiry date, and the new licence with an expiry date that looked longer than the term that was paid for. The researcher is honest that the behaviour was hard to reproduce and that it might only be a display problem, but reported it because of the possible effect: an existing licence could end up lasting longer than it should.
This kind of flaw is called a business logic error. It is not a broken lock or a crashed program. The software does exactly what it was programmed to do, but the rules it follows are wrong. A useful comparison is a shop till that gives the right change for one item but gets confused when you buy two items together: nothing is technically broken, the arithmetic rule is just wrong.
The setup
The researcher was acting as a customer of a company that already had a licence. Three things were needed before the test could start:
- An existing licence. In this case it was a licence for 4 users with a known expiry date.
- The ability to buy an additional licence through the normal purchase flow and pay for it.
- Access to the page where the customer's licences are listed after the purchase.
No special tools, software versions or configuration are mentioned. The researcher notes that reproducing the issue is difficult. They also say they did not test whether the remaining time on the old licence could still be used, because doing so would consume licences, and licences cost money.
Finding it
The researcher's original goal was to check whether the licence still worked after some event, which is redacted in the report. While doing that, they went back to the licence listing page after a purchase and noticed something unexpected.
The company had bought one more licence with a 5 year term. The existing licence covered 4 users and had a known expiry date. After paying and receiving the new licence, the listing showed the existing licence changed from 4 users to 1 user, and its expiry date changed to a different value. The researcher calls this interesting and worth reporting even if it turns out to be only a display issue.
Exploitation
Step 1: Confirm the existing licence
Start from an existing licence. In the researcher's case this was a 4 user licence with a known expiry date. Writing down the starting state matters: without knowing what the licence looked like before, you cannot tell what changed afterwards.
Step 2: Buy an additional licence
Buy a new one user licence with a 5 year term and pay for it through the normal flow. This is the ordinary purchase any customer would make, not a specially crafted request. That is typical of business logic bugs: the tester uses the product the way it is meant to be used and watches whether the rules hold.
Step 3: Check the licence listing
After receiving the licence, check it on the licence page. The researcher's observations were:
- The existing licence changed from 4 users to 1 user, and its expiry date changed to a different value. The researcher did not test whether the remaining time on the old licence could still be used, because that would consume licences.
- The new licence should have expired at around a date consistent with its 5 year term, but the listing showed a different date. In the researcher's reading, this means the new licence's expiry date was extended.
The report does not include the page URL, the request or response bodies, or the exact dates; those values are redacted in the text.
Step 4: Generalise the abuse
The researcher's conclusion is that a user can use this behaviour to extend an existing licence. The example given: buy a one year licence, which expires next year, then buy one more licence that expires in 10 years. The result is two licences that both expire in 10 years. In other words, the short licence appeared to inherit the long term of the second purchase, though the researcher did not rule out that this was only a display issue.
Root cause
The report does not identify a code-level cause. What it describes is a logic problem in how the purchase of an additional licence is merged into the customer's existing licence record. It describes only what the listing showed after the purchase: the old licence's user count and expiry date changed, and the new licence's expiry date appeared longer than its term. Whether this is a persistence bug or only a rendering bug in the listing is left open by the researcher, who says it may prove to be a display issue.
A persistence bug means the wrong value is actually stored in the site's database, so it stays wrong everywhere. A rendering bug means the stored data is fine and only the page draws it wrongly, so a reload or a different view might show the correct value. The difference matters a lot: a rendering bug is cosmetic, a persistence bug affects what the customer really owns. The report does not describe any validation or server-side check that should have prevented the merge.
Impact
Under the conditions described, a customer who buys an additional licence can end up with licences whose expiry dates are extended beyond what was paid for. The researcher's example is buying a short licence and then a long one so that both end up with the long expiry. The report hedges this: the researcher could not confirm whether the old licence's remaining time was still usable, and did not rule out that the effect is only in the display of the licence page. The report does not state a severity, a CVSS score or a bounty.
Fix
What the behaviour calls for is that the purchase of an additional licence creates or updates only the new entitlement, leaving the existing licence's user count and expiry date unchanged, and that the expiry date shown for each licence is derived from that licence's own term rather than from another licence on the account.
Variants to test
- Buy a short-term licence on an account that already holds a long-term licence and check whether the older licence's expiry date moves. A positive result is the old licence showing the new term.
- Buy a licence with a different user count and check whether the existing licence's user count is overwritten. A positive result is the old licence showing the new count.
- Repeat the purchase and check whether the effect compounds across multiple licences on the same account.
- Check whether the change is persisted, for example by reloading the page, logging out and back in, or querying the licence through any API the site exposes. A positive result is the extended date surviving a fresh session rather than appearing only once.
- Check whether the extended licence is actually usable, for example by activating it on a product, if doing so does not consume a licence you need.
An API (application programming interface) is the part of a website that answers requests from software rather than from a person clicking buttons. When you load a page, your browser is really asking the site for data; an API is the same conversation without the page around it. Checking through an API is useful because it shows the raw stored values, separate from however the page chooses to draw them.
Hunting notes
This kind of bug hides in purchase and entitlement flows where an account can hold more than one item of the same type: licence upgrades, seat additions, renewals and plan changes. The signal is a listing page that shows derived values, such as expiry dates and seat counts, that are computed from more than one record. When testing, record the state before the purchase, make the purchase, and compare each field of every existing item afterwards, not just the new one. The researcher described the before and after state of both licences and gave a concrete abuse example, while being clear about what had not been confirmed.
Glossary
- Business logic error: a flaw where the software follows its programmed rules correctly, but those rules are wrong, so the outcome is unfair or unintended.
- Licence: a permission to use a product, here described by a number of users and an expiry date.
- Entitlement: what a customer is entitled to use, such as a licence with a given user count and term.
- Expiry date: the date on which a licence stops being valid.
- User count: the number of people a licence allows to use the product.
- Purchase flow: the sequence of pages and steps a customer goes through to buy something on a website.
- Reproduce: to make a bug happen again on purpose, so it can be studied and confirmed.
- Display issue: a problem that only affects what is shown on screen, while the stored data is correct.
- Persistence bug: a bug where the wrong value is actually saved in the site's database and stays wrong.
- Rendering bug: a bug where the stored data is correct but the page draws it incorrectly.
- API: the part of a website that answers requests from software, returning raw data rather than a finished page.
- Session: the period during which a site remembers who you are, usually kept going by a cookie or token.
- Cookie or token: a small piece of data your browser stores and sends back to a site so the site can recognise you between requests.
- Server-side check: a validation performed on the site's own computers, which a user cannot bypass by editing what their browser sends.
- CVSS score: a standard number used to express how severe a security flaw is.
- Bounty: a payment made to a researcher who reports a valid security flaw.
- Vendor: the company that makes and sells the product.