Skip to content
IDOR Write-up Beginner

Critical BAC: IDOR + Weak Appointment Code Enables Unauthorized Appointment Cancellation…

The appointment management API used a short, partly predictable appointment code as the only authorisation check, so anyone with a valid code could read, change or cancel another person's appointment. Because a valid code also returned the owner's name, phone, email and address, guessing or obtaining a code could expose personal data and disrupt real appointments.

kjulius Follow

Published on kjulius.medium.com

Broken Access Control

kjulius, on kjulius.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

The target was a public-facing pre-complaint system, a service that lets citizens register complaints and book appointments with a police-related organisation. The feature under review was appointment management: after booking, the system emails the user a confirmation containing a short appointment code, and that code is used to look up, modify or cancel the appointment.

The code followed a pattern similar to:

Text
CGXXXX

The CG prefix was static across the researcher's test appointments, leaving only four variable characters, drawn from uppercase letters and digits. The researcher gives the effective keyspace as:

3⁶⁴ = 1,679,616 combinations

That figure is as stated in the write-up. The point the author makes is that entropy was not the main problem: the bigger issue was how the code was used.

Setup

The write-up does not describe the tooling, the number of accounts created, or any specific versions. No authenticated session or additional ownership verification was required for the vulnerable endpoints.

Finding it

While testing the appointment-management functionality, the researcher observed that the backend treated the appointment code itself as the authorization mechanism. The functionality exposed was equivalent to:

HTTP
GET /api/<redacted>/appointments/{code}
DELETE /api/<redacted>/appointments/{code}
From the original on kjulius.medium.com
PoC Images.

No authenticated session or additional ownership verification was required. That is the core observation: the only thing standing between a caller and someone else's appointment was knowledge of a short, partly predictable code.

Exploitation

Step 1: Obtain a valid appointment code

Booking an appointment through the normal flow produced a confirmation email containing a code of the form CGXXXX. The CG prefix was static across the researcher's test appointments, so only four characters varied.

Step 2: Call the appointment endpoint with the code

Supplying a valid appointment code to the endpoint above returned the personal information associated with that appointment, without any session or ownership check. The fields returned included:

  • First and last name
  • Telephone number
  • Email address
  • Street/address
  • ZIP/postal code
PoC Image. From the original on kjulius.medium.com

The same code could then be used to interact with the appointment, including modification and cancellation through the corresponding endpoint.

Step 3: Assess the keyspace

With a static prefix and four variable characters over uppercase letters and digits, the researcher calculated the effective keyspace as 3⁶⁴ = 1,679,616 combinations, as quoted in the write-up. The author stresses that the weak code was not the whole story: the missing authorization check is what turned a guessable identifier into direct access to data and actions.

Root cause

The design mistake was using the appointment code as the sole authorization mechanism. The backend exposed read, modify and cancel operations keyed on that code, and performed no authenticated session check and no ownership verification before acting on it. Because the code was short and partly static, an attacker who obtained or successfully guessed a valid code could retrieve the associated PII and then use the same code to interact with the appointment.

The write-up does not show the server-side code, so the exact implementation gap is not documented; what is documented is the observable behaviour: no session, no ownership check, PII returned on a valid code. The report recommends rate limiting, lockouts and monitoring for repeated failed code attempts, but does not say whether any such controls were present.

Impact

The vulnerability affected confidentiality, integrity and availability.

  • Confidentiality. A valid appointment code could expose personally identifiable information belonging to the appointment owner, including name, phone number, email, street address and date of birth. The list of fields returned in the exploitation section covers name, telephone, email, street/address and ZIP/postal code; the impact section additionally mentions date of birth.
  • Integrity. The modification functionality could allow unauthorised changes to appointment details.
  • Availability. The cancellation functionality could allow an unauthorised party to cancel another citizen's appointment.

For a police-related service, the author notes real-world consequences for people attending appointments concerning theft, fraud, property damage, insurance claims, evidence collection and other time-sensitive matters. The impact depends on an attacker obtaining or successfully guessing a valid code; the report frames this as a potential outcome rather than a demonstrated mass enumeration.

Fix

The appointment code should not be the sole authorization mechanism. The report recommends that the application should:

  1. Require ownership verification through the email associated with the appointment.
  2. Use high-entropy, unpredictable appointment tokens without static prefixes.
  3. Implement strong server-side rate limiting and lockouts.
  4. Use short-lived, signed or single-use authorization tokens for sensitive actions.
  5. Avoid returning sensitive PII unless the requester has been properly authenticated and authorized.
  6. Monitor repeated failed appointment-code attempts for enumeration activity.
From the original on kjulius.medium.com
PoC Images.

The takeaway the author draws is that knowing an object's identifier should never automatically grant access to its data or control over it. The core issue was the combination of predictable identification, unauthorised PII disclosure and missing authorization controls.

Variants to test

  • Short reference codes on other public services. Look for confirmation emails containing short alphanumeric references with a fixed prefix. A positive result is that changing only the variable portion returns another user's record without a session.
  • Identifier-as-authorization on modify and cancel endpoints. Test whether the same code accepted by a read endpoint also works on state-changing methods. A positive result is a successful modification or cancellation of a record you do not own.
  • PII in lookup responses. Check whether a successful lookup returns more fields than the UI displays. A positive result is name, phone, email or address data appearing in the API response.
  • Enumeration without lockout. Send repeated invalid codes and observe whether the server throttles or locks the caller. A positive result is a sustained response rate with no lockout, which makes guessing feasible.
  • Static prefixes across accounts. Create several accounts and compare the generated codes. A positive result is a shared prefix that reduces the effective keyspace.
  • Date of birth and other sensitive fields. Where the report's impact section mentions date of birth, check whether such fields are returned by the lookup endpoint even when the UI does not show them.

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

What happened, in plain words

A security researcher was testing a website that lets members of the public file complaints and book appointments with a police-related organisation. Think of it as a booking system, like the one a dentist or a garage uses: you pick a time, you get a confirmation, and later you can look up, change or cancel that booking.

When you booked an appointment, the system sent you a confirmation email containing a short code, something like CGXXXX. That code was the only thing the website asked for when you wanted to see, change or cancel the appointment. There was no login and no check that the person typing the code was the person who booked.

The researcher found that anyone who knew or guessed a valid code could read the personal details attached to that appointment (name, phone number, email, address, postcode) and could also change or cancel it. Because the code was short and partly predictable, an attacker who obtained or successfully guessed a valid code could reach another person's appointment.

The finding was later marked as a duplicate, meaning someone else had reported the same problem first. It was rated 9.8 out of 10, Critical, using a standard scoring system called CVSS.

By kjulius From the original on kjulius.medium.com

The pieces you need to know

Before the details, a few everyday ideas. None of this is specific to this website; it is how most modern web services work.

An API. When you use a website, your browser shows you pages with buttons and text. Behind those pages, the browser often talks to the server through an API (Application Programming Interface). An API is a set of addresses on the server that accept requests and send back data, usually in a compact format rather than a pretty page. A useful comparison: the website is the shop counter, and the API is the back door the staff use to fetch stock. If the back door is left unlocked, it does not matter how tidy the counter looks.

A request and a method. Every time your browser asks the server for something, it sends a request. Each request has a method, which is a verb telling the server what kind of action you want. GET means "give me something" (read). DELETE means "remove this". There are others, such as POST for creating and PUT or PATCH for changing. The method matters because a read and a delete can point at the same address but do very different things.

A URL and a path parameter. A URL is the address you see in the browser bar. The part after the domain, like /appointments/123, is the path. The 123 in that example is a path parameter: a value slotted into the address that tells the server which specific record you mean. Change the number and you are asking about a different record.

Authentication and authorization. These two words sound alike but mean different things. Authentication is proving who you are, like showing your passport at the airport. Authorization is deciding what you are allowed to do once you are known, like the passport not giving you access to the cockpit. A system can authenticate you perfectly and still authorize you badly.

A session and a cookie. When you log in somewhere, the server usually gives your browser a small piece of data called a session cookie. Your browser sends it back with every request, and the server uses it to recognise you on the next page. It is like a wristband at an event: you show it once at the gate, then staff glance at it to let you back in. If a request carries no valid wristband, the server should refuse it.

A token. A token is a value that stands in for proof of something. A session cookie is one kind of token. Another kind is a one-off code that grants access to a single record. The security question with any token is: what exactly does it prove, and to whom?

Broken Access Control (BAC). This is the name for the whole family of bugs where the server fails to check whether the person making a request is allowed to make it. The person might be logged in, or not logged in at all; either way, the server acts on the request without asking "should you be doing this?". It is consistently one of the most common and most damaging classes of web vulnerability, because it turns ordinary features into ways to reach other people's data.

IDOR (Insecure Direct Object Reference). This is a specific flavour of Broken Access Control. It happens when the server uses a value supplied by the user (an ID, a reference number, a code) to pick a record, and does not check that the user owns that record. The classic example is a URL like /invoice?id=1001 where changing 1001 to 1002 shows you someone else's invoice. The identifier is doing the job that an authorization check should be doing.

PII (Personally Identifiable Information). Any data that can identify a specific person: name, phone number, email, home address, date of birth. Leaking PII is serious on its own, because it enables fraud, harassment and identity theft, even if nothing is changed or deleted.

Entropy and keyspace. Entropy is a measure of unpredictability. Keyspace is the total number of possible values something could take. If a code has four variable characters and each can be one of 36 symbols (26 letters plus 10 digits), the number of possible codes is 36 multiplied by itself four times. The larger the keyspace, the harder guessing becomes. A fixed prefix shrinks the keyspace, because part of the code is already known.

Enumeration. Trying many possible values one after another, systematically, to find one that works. If a server lets you try thousands of codes without slowing you down, enumeration becomes practical.

Rate limiting and lockout. Rate limiting means the server refuses to answer more than a certain number of requests in a period. Lockout means it temporarily blocks you after too many failures. Both are the digital equivalent of a cash machine that swallows your card after three wrong PINs.

CVSS. The Common Vulnerability Scoring System is a standard way of scoring how severe a vulnerability is, from 0 to 10. A score of 9.8 is in the Critical band. The score is built from a vector string, a compact list of characteristics, which we will unpack later.

The target and the feature

The target was a public-facing pre-complaint system. In plain terms, it is a service where a citizen can register a complaint and book an appointment with a police-related organisation, for example to discuss a theft, a fraud, property damage or an insurance claim.

The feature under review was appointment management. After booking, the system emailed the user a confirmation containing a short appointment code. That code was then used to look up, modify or cancel the appointment. So the code was not just a reference number printed for your convenience; it was the key to the booking.

The code followed a pattern similar to:

Text
CGXXXX

Line by line: CG are two fixed letters, and XXXX stands for four characters that vary from appointment to appointment. The researcher found that the CG prefix was static across their test appointments, so only the four variable characters actually changed. Those four characters were drawn from uppercase letters and digits.

The researcher gives the effective keyspace as:

3⁶⁴ = 1,679,616 combinations

That figure is as stated in the write-up. The important point the author makes is that the small keyspace was not the main problem. The bigger issue was how the code was used: as the only thing the server checked before handing over or changing a booking.

Setting up

The write-up does not describe the tooling used, how many accounts were created, or any specific software versions. No logged-in session or additional ownership verification was needed to reach the vulnerable addresses.

That last point is worth pausing on. Many people assume a bug like this needs an account, a password or some kind of access. Here it did not. The starting position was the same as any member of the public: book an appointment, get an email, read the code.

Finding it

While testing the appointment-management functionality, the researcher observed that the backend treated the appointment code itself as the authorization mechanism. In other words, the server's answer to "are you allowed to see this appointment?" was simply "do you know the code?".

The functionality exposed was equivalent to:

HTTP
GET /api/<redacted>/appointments/{code}
DELETE /api/<redacted>/appointments/{code}

Line by line:

  • GET /api/<redacted>/appointments/{code} is a read request. GET means "give me this". /api/ marks the API area of the site. <redacted> stands for a part of the path that has been hidden. /appointments/ says which kind of record is wanted, and {code} is a placeholder for the appointment code, the value that selects which appointment.
  • DELETE /api/<redacted>/appointments/{code} is a removal request. DELETE means "remove this". It points at the same kind of address, with the same code placeholder, but the verb tells the server to cancel the appointment rather than return it.

The two lines together show that the same short code controlled both reading and cancelling, with no session or ownership check.

From the original on kjulius.medium.com
PoC Images.

No authenticated session or additional ownership verification was required. That is the core observation: the only thing standing between a caller and someone else's appointment was knowledge of a short, partly predictable code. The server never asked "is this your appointment?", only "is this a real code?".

Exploitation

Step 1: Obtain a valid appointment code

Booking an appointment through the normal flow produced a confirmation email containing a code of the form CGXXXX. The CG prefix was static across the researcher's test appointments, so only four characters varied.

Why this step matters: to test whether the code alone grants access, you first need a code that is known to be valid. Booking your own appointment gives you exactly that, without touching anyone else's data. It is the controlled starting point. The observation about the static prefix is a separate finding: it tells you how much of the code an outsider already knows before they start guessing.

Step 2: Call the appointment endpoint with the code

Supplying a valid appointment code to the endpoint above returned the personal information associated with that appointment, without any session or ownership check. The fields returned included:

  • First and last name
  • Telephone number
  • Email address
  • Street/address
  • ZIP/postal code
PoC Image. From the original on kjulius.medium.com

Why this step matters: this is the moment the bug becomes visible. The request carried no session cookie and no proof that the caller owned the appointment, yet the server answered with the record. In a correct design, the server would either refuse the request or return only a harmless confirmation such as "appointment exists". Instead it returned the personal details of the person who booked.

The same code could then be used to interact with the appointment, including modification and cancellation through the corresponding endpoint. So the code was not just a read key; it was also a write key and a delete key. One short string gave full control over the booking.

Step 3: Assess the keyspace

With a static prefix and four variable characters over uppercase letters and digits, the researcher calculated the effective keyspace as 3⁶⁴ = 1,679,616 combinations, as quoted in the write-up.

Why this step matters: it turns "the code is short" into a number. The author stresses that the weak code was not the whole story: the missing authorization check is what turned a guessable identifier into direct access to data and actions. A long, random code would have made guessing harder, but the design flaw would still be there.

Root cause

The design mistake was using the appointment code as the sole authorization mechanism. The backend exposed read, modify and cancel operations keyed on that code, and performed no authenticated session check and no ownership verification before acting on it. Because the code was short and partly static, an attacker who obtained or successfully guessed a valid code could retrieve the associated PII and then use the same code to interact with the appointment.

A comparison helps here. Imagine a hotel where the room number is the only thing the front desk checks before handing over a key. If room numbers were long and secret, it might just about work. But room numbers are printed on doors, mentioned in conversation and easy to guess in sequence. The right design is a key card that is tied to you and checked against a list, not a number anyone can recite.

The write-up does not show the server-side code, so the exact implementation gap is not documented. What is documented is the observable behaviour: no session, no ownership check, PII returned on a valid code. The report recommends rate limiting, lockouts and monitoring for repeated failed code attempts, but does not say whether any such controls were present.

Impact

The vulnerability affected confidentiality, integrity and availability. These three words are the standard way of describing what a security failure can damage, and it is worth knowing them because they appear in almost every report.

  • Confidentiality means keeping data secret from people who should not see it. Here, a valid appointment code could expose personally identifiable information belonging to the appointment owner, including name, phone number, email, street address and date of birth. The list of fields returned in the exploitation section covers name, telephone, email, street/address and ZIP/postal code; the impact section additionally mentions date of birth.
  • Integrity means keeping data correct and unaltered. Here, the modification functionality could allow unauthorised changes to appointment details. The modification functionality could allow unauthorised changes to appointment details.
  • Availability means keeping the service usable for the people who rely on it. Here, the cancellation functionality could allow an unauthorised party to cancel another citizen's appointment. The record still exists, but the person who needed it has lost their slot.

For a police-related service, the author notes real-world consequences for people attending appointments concerning theft, fraud, property damage, insurance claims, evidence collection and other time-sensitive matters.

The impact depends on an attacker obtaining or successfully guessing a valid code. The report frames this as a potential outcome rather than a demonstrated mass enumeration. In other words, the researcher showed that a valid code grants access, but did not claim to have walked through thousands of other people's records.

Fix

The appointment code should not be the sole authorization mechanism. The report recommends that the application should:

  1. Require ownership verification through the email associated with the appointment. In plain terms, before showing or changing a booking, the server should confirm that the person asking controls the email address the booking was made with, for example by sending a one-time link to that address.
  2. Use high-entropy, unpredictable appointment tokens without static prefixes. A long random value, with no fixed letters at the start, makes guessing impractical.
  3. Implement strong server-side rate limiting and lockouts. The server, not the browser, should count attempts and stop callers who try too many.
  4. Use short-lived, signed or single-use authorization tokens for sensitive actions. A token that expires quickly, or works only once, limits the damage if it leaks.
  5. Avoid returning sensitive PII unless the requester has been properly authenticated and authorized. Even a correct code should not be enough on its own to reveal a full name and address.
  6. Monitor repeated failed appointment-code attempts for enumeration activity. Watching for patterns of wrong codes lets the operator spot an attack in progress.

The finding was eventually marked as a duplicate, with a CVSS:3.1 vector of AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H scoring 9.8 (Critical).

That vector string looks cryptic, but it is just a list of answers to standard questions. AV:N means the attack can be carried out over the network, not from the same machine. AC:L means the attack complexity is low. PR:N means no privileges are required, so no account is needed. UI:N means no user interaction is required, so the victim does not have to click anything. S:U means the scope is unchanged, so the impact stays within the vulnerable component. C:H, I:H and A:H mean high impact on confidentiality, integrity and availability. Put together, that is a 9.8, Critical.

From the original on kjulius.medium.com
PoC Images.

The takeaway the author draws is that knowing an object's identifier should never automatically grant access to its data or control over it. The core issue was the combination of predictable identification, unauthorised PII disclosure and missing authorization controls. Together they meant an attacker who obtained or successfully guessed a valid code could read and cancel someone else's appointment.

Variants to test

If you want to look for similar problems in other services, these are the patterns the author suggests trying. Each one is a small experiment you can run with a browser and, where needed, a tool that lets you edit requests.

  • Short reference codes on other public services. Look for confirmation emails containing short alphanumeric references with a fixed prefix. A positive result is that changing only the variable portion returns another user's record without a session.
  • Identifier-as-authorization on modify and cancel endpoints. Test whether the same code accepted by a read endpoint also works on state-changing methods. A positive result is a successful modification or cancellation of a record you do not own.
  • PII in lookup responses. Check whether a successful lookup returns more fields than the UI displays. A positive result is name, phone, email or address data appearing in the API response.
  • Enumeration without lockout. Send repeated invalid codes and observe whether the server throttles or locks the caller. A positive result is a sustained response rate with no lockout, which makes guessing feasible.
  • Static prefixes across accounts. Create several accounts and compare the generated codes. A positive result is a shared prefix that reduces the effective keyspace.
  • Date of birth and other sensitive fields. Where the report's impact section mentions date of birth, check whether such fields are returned by the lookup endpoint even when the UI does not show them.

Glossary

  • API (Application Programming Interface): a set of addresses on a server that accept requests and return data, used by the website behind the scenes.
  • Authentication: proving who you are, for example by logging in.
  • Authorization: deciding what a known person is allowed to do.
  • Availability: the property of a service being usable by the people who need it.
  • Broken Access Control (BAC): a vulnerability class where the server fails to check whether the requester is allowed to perform the action.
  • Confidentiality: the property of data being kept secret from people who should not see it.
  • Cookie: a small piece of data a website stores in your browser and your browser sends back with each request, often used to recognise a logged-in session.
  • CVSS (Common Vulnerability Scoring System): a standard 0 to 10 scale for rating the severity of a vulnerability, built from a vector string of characteristics.
  • DELETE: an HTTP method meaning "remove this".
  • Entropy: a measure of how unpredictable a value is.
  • Enumeration: systematically trying many possible values to find one that works.
  • GET: an HTTP method meaning "give me this", used for reading.
  • IDOR (Insecure Direct Object Reference): a form of Broken Access Control where a user-supplied identifier selects a record without an ownership check.
  • Integrity: the property of data being correct and unaltered.
  • Keyspace: the total number of possible values a code or key could take.
  • Lockout: temporarily blocking a caller after too many failed attempts.
  • Method: the verb in an HTTP request, such as GET or DELETE, that says what kind of action is wanted.
  • Path parameter: a value slotted into a URL path, such as a code or ID, that selects which record is meant.
  • PII (Personally Identifiable Information): data that can identify a specific person, such as name, phone, email or address.
  • Rate limiting: refusing to answer more than a set number of requests in a period.
  • Request: a message your browser or tool sends to a server asking it to do something.
  • Session: a period during which the server recognises you as the same person across multiple requests, usually via a cookie.
  • Token: a value that stands in for proof of something, such as a session cookie or a one-time code.
  • URL: the address of a resource on the web, as shown in the browser bar.

More by kjulius

View all

11 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.