How a Single % Turned a Booking Lookup Into a PII Leak
A booking lookup endpoint used the passenger surname as a proof-of-ownership check, but the surname was passed into a SQL LIKE comparison, so a single percent wildcard matched any surname. An attacker who knew only a booking reference could retrieve full passenger PII including national ID, date of birth, email and phone number.
infosecwriteups.com
Published on infosecwriteups.com
Bug Bounty
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
The target was a booking lookup feature. The application told the user, in effect: give me the booking reference and the passenger's surname, and I will show you the booking. The booking reference plus a surname acted as a proof-of-ownership check before passenger data was returned.
The researcher describes the feature as a booking lookup page, nothing fancy, and the whole article is about what happened when the surname field was treated as a pattern rather than a literal value.
Setup
The report does not describe any accounts, roles, versions or special preconditions. The only tool named is Burp Suite, used to watch the requests and change values. The workflow was the usual one: open Burp Suite, watch the requests, change things that probably should not be changed.
Finding it
The lookup request looked roughly like this:
{ "pnrNo": "XXXXXX", "surname": "DOE", "language": "EN"}
The intended logic was:
Booking Reference +Surname ↓Booking ↓Passenger information
The researcher first tested the obvious cases. A correct surname worked. A wrong surname was rejected. At that point the control looked properly implemented.
Then the surname parameter was probed with different casing, partial values and special characters. Nothing was exciting until the question: what happens if I just put % here?
Exploitation
Step 1: replace the surname with a single wildcard
The value was changed from:
"surname": "DOE"
to:
"surname": "%"
The request was sent and the response was HTTP 200. The booking was returned. The request was checked again: not the actual surname, not a partial surname, just %, and the server accepted it.

Step 2: repeat to rule out noise
The researcher considered that one odd response is not enough: maybe there was strange frontend validation, maybe something was cached, maybe the server had a bad day. So the request was sent again:
{ "pnrNo": "XXXXXX", "surname": "%"}
The same result came back: the booking was returned.
Step 3: test other wildcard-style inputs
Other pattern-like values were tried, for example:
and:
The behaviour continued to look like pattern matching.
Step 4: rule out plain partial matching
To make sure the application was not simply allowing partial surnames, ordinary partial values were tried. Something like:
was rejected. Then:
was also rejected. This was the important part: the application was not saying that any surname starting with D is fine. The wildcard itself was changing the meaning of the comparison.
Step 5: read the response
The endpoint was not returning just a booking ID or a success message. It returned passenger information. The response contained fields such as:
{ "passengerList": [ { "birthDate": "[PASSENGER DOB]", "gender": "M", "nationalId": "[NATIONAL ID]", "name": "[PASSENGER NAME]", "surname": "[PASSENGER SURNAME]" } ], "contactPersonSummary": { "email": "[PASSENGER EMAIL]", "phoneNumber": { "countryCode": "[COUNTRY CODE]", "areaCode": "[AREA CODE]", "number": "[PHONE NUMBER]" } }, "pnrInfo": { "pnrNo": "[BOOKING REFERENCE]" }, "ticketNumberList": [ "[TICKET NUMBER]" ]}
The researcher did not publish the actual passenger information. The response contained full name, surname, date of birth, national ID, email address, phone number, booking information and ticket information, and the only inputs supplied were the booking reference and %.
Root cause
The behaviour is consistent with the backend building a comparison conceptually similar to:
WHERE surname LIKE :surname
In that construct % is not a literal character: it means match zero or more characters. So surname LIKE '%' asks whether the surname contains absolutely anything, which is always true. The application expected % to mean the passenger's surname is %; the database understood it as not caring what the surname is.
The surname was not merely a search filter. It was acting as a proof-of-ownership factor. The intended flow was:
I know the booking reference +I know the passenger's surname ↓I can access the booking
With the wildcard it became:
I know the booking reference +I know "%" ↓I can access the booking
The attacker no longer needs the passenger's actual surname, so the security control is effectively gone. That is why this is an authorization bypass leading to sensitive information disclosure, not just a search that accepts funny characters.
The report also notes that another version of the booking-search flow already had an OTP verification step. Instead of immediately returning passenger information, it could respond with something like:
{ "verificationRequired": true, "passengerList": []}
But some older booking-search functionality was still returning the full passenger record without the same protection. The security model of the new flow was OTP followed by passenger PII, while the older flow was booking reference plus surname followed by passenger PII, and with % the surname check was bypassed. The report does not state why the older flow was left in place or how the two flows were routed.
Impact
An attacker who knows a booking reference can retrieve the associated passenger data without knowing the surname. The data returned includes full name, surname, date of birth, national ID, email address, phone number, booking information and ticket information. The report does not quantify how many bookings were exposed.
The vulnerability was reported through the bug bounty program and, after review, was accepted as High severity and rewarded.

Fix
Based on the root cause, the surname should not be interpolated into a LIKE pattern for an authorization decision: it should be compared as a literal value, with wildcard characters escaped or the query changed to an equality comparison. The older booking-search flow should also be brought behind the same OTP verification that the newer flow already uses, so that both paths enforce the same proof-of-ownership step before returning passenger PII.
Variants to test
- Send
%as the surname on any lookup that pairs a reference with a secondary identifier. A positive result is HTTP 200 with the full record instead of a rejection. - Send
_as the surname. In SQLLIKE,_matches exactly one character, so a positive result is a record returned for a single-character surname. - Send
D%and%ALto confirm pattern semantics rather than prefix matching. A positive result is a record returned for a surname that does not literally equal the input. - Send plain partial values such as
DandDAas controls. A rejection here, alongside acceptance of%, shows the wildcard is changing the comparison rather than the application allowing partial matches. - Look for older or parallel versions of the same lookup flow that lack the OTP step seen on the newer one. A positive result is a response containing passenger PII where the newer flow would return
{"verificationRequired": true, "passengerList": []}. - Check other fields used as ownership factors (date of birth, last four digits of a document, email) for the same pattern behaviour. A positive result is a record returned without the correct literal value.
What happened, in plain words
A website had a page where you could look up a booking. To see the booking, you had to type two things: the booking reference (a short code that identifies the booking) and the passenger's surname. The idea was that only someone who knows both could see the passenger's details.
The researcher found that typing a single percent sign % instead of the real surname made the site hand over the whole booking, including the passenger's full name, date of birth, national ID, email address and phone number. The surname check was effectively switched off by one character.
This article walks through the same steps the researcher took, in the same order, and explains every term along the way. You only need to know how to use a browser and a computer to follow it.
Some words you will meet first
Before the steps, a few everyday ideas. Each one comes back later, so do not worry about memorising them now.
- A web page is what you see in your browser. Behind it, the browser and a computer somewhere else (the server) exchange messages.
- An API is the part of a website that answers those messages with data rather than with a pretty page. Think of a restaurant: the menu and the dining room are the website you see, and the kitchen is the API. You ask the waiter for a dish, the kitchen prepares it and sends it back. When a page needs to show your booking, it asks the API for it.
- A request is the message your browser sends to ask for something. A response is the message that comes back. A request usually carries some parameters: named pieces of information, like
surnamewith the valueDOE. - JSON is a common way of writing those parameters and responses as text. It uses curly braces
{ }to group things, quotes around names and values, and commas between entries. It looks like a shopping list written by a very tidy person. - HTTP 200 is the status code a server sends when everything went fine. You have seen the opposite: a page saying "not found" is usually HTTP 404. So HTTP 200 means "here is your answer".
- Burp Suite is a tool that sits between your browser and the website and lets you read and change the messages going back and forth. Think of it as opening the envelope, reading the letter, editing it and sealing it again before it is delivered. The researcher used it to watch requests and change values.
- A parameter is one named field in a request, for example
surname. Changing a parameter means changing the value attached to that name. - PII stands for personally identifiable information: data that identifies a real person, such as a name, date of birth, national ID, email address or phone number.
- A wildcard is a character with a special meaning in a pattern. In many systems
%means "anything at all". It is like writing "any name" on a form instead of an actual name. - SQL is the language used to talk to a database, which is the place where a website stores its data. A database is like a huge set of spreadsheets. SQL is how the website asks questions such as "find the booking with this reference".
LIKEis a SQL instruction for matching text against a pattern rather than against an exact value. It is the difference between "find the person called Doe" and "find anyone whose name looks a bit like this".- An authorization bypass means getting past a check that is supposed to decide whether you are allowed to do something. It is not about guessing a password; it is about making the permission check itself give the wrong answer.
- OTP stands for one-time password: a short code, often sent by SMS or email, that you must type to prove it is really you. It is the code you get when a bank wants to be extra sure.
The booking lookup
The feature was a booking lookup page. The application told the user, in effect: give me the booking reference and the passenger's surname, and I will show you the booking.
So the flow had two things you had to know: the booking reference (often called a PNR, short for passenger name record, the airline industry's name for a booking code) and the surname. Together they acted as a loose proof that the booking was yours. It is a bit like a cloakroom ticket: the number alone is not enough, you also need to describe the coat.
The request the page sent looked roughly like this:
{ "pnrNo": "XXXXXX", "surname": "DOE", "language": "EN"}
Line by line, in plain words:
- The outer
{and}wrap the whole message. Everything inside is one request. "pnrNo": "XXXXXX"is the booking reference. TheXXXXXXis a placeholder: the real code is not published."surname": "DOE"is the passenger's surname.DOEis a made-up example surname."language": "EN"tells the server which language to answer in, here English.- The commas separate the entries, and each name is in quotes followed by a colon and its value in quotes.
The intended logic was:
Booking Reference +Surname ↓Booking ↓Passenger information
This is a little diagram, not code. Read it top to bottom: you supply the booking reference and the surname, the server looks up the booking, and it returns the passenger information. The arrows mean "leads to".
The researcher first tested the obvious cases. A correct surname worked. A wrong surname was rejected. At that point the check looked properly implemented, which is exactly why the next step was worth doing: if a check looks solid, the interesting question is what it does with input it did not expect.
Trying to break the surname
The surname parameter was then probed with different casing (upper and lower case letters), partial values (only part of the surname) and special characters. Nothing was exciting.
Then came the classic bug-hunting question: what happens if I just put % here?
Why ask that? Because % is the character many systems use to mean "anything". If the website passes your input to a database that treats % as a wildcard, then a surname of % might mean "any surname at all". It is the same idea as searching a photo album for "*" and getting every photo back.
Step 1: replace the surname with a single wildcard
The value was changed from:
"surname": "DOE"
This is one line from the request: the field named surname with the value DOE. The quotes around each part are part of the JSON format.
to:
"surname": "%"
Same line, but now the value is a single percent sign. Nothing else in the request changed.
The request was sent and the response was HTTP 200. The booking was returned. The request was checked again: not the actual surname, not a partial surname, just %, and the server accepted it.

Why does this matter? Because the whole point of asking for the surname is to prove you know something only the passenger would know. If % is accepted, that proof is gone. It is as if a bouncer asks for your name, you answer "anyone", and he lets you in.
Step 2: repeat to rule out noise
One odd response is not enough. Maybe there was strange validation in the browser, maybe something was cached (an old answer stored and reused), maybe the server had a bad day. So the request was sent again:
{ "pnrNo": "XXXXXX", "surname": "%"}
Line by line:
- The outer braces wrap the request.
"pnrNo": "XXXXXX"is the same placeholder booking reference as before."surname": "%"is the wildcard instead of a real surname.- Notice that the
languagefield from the first request is not here. The report shows the request this way; the important part is the surname value.
The same result came back: the booking was returned. Repeating a test is basic good practice. If a result happens once, it might be a fluke; if it happens twice with the same input, it is probably real behaviour.
Step 3: test other wildcard-style inputs
Other pattern-like values were tried, for example:
This means "a D followed by anything". If the server treats it as a pattern, it should match any surname starting with D.
and:
This means "anything followed by AL". If the server treats it as a pattern, it should match any surname ending in AL.
The behaviour continued to look like pattern matching. In other words, the server was not comparing the text literally; it was interpreting the special characters. That is a strong hint that the input ends up inside a database pattern match rather than a plain equality check.
Step 4: rule out plain partial matching
There was still an innocent explanation to eliminate: maybe the site simply accepts partial surnames. Some sites do that on purpose, so that you can find a booking even if you are not sure how the name is spelled.
To check, ordinary partial values were tried. Something like:
was rejected. Then:
was also rejected.
This was the important part. If the site allowed partial names, D and DA would have worked. They did not. So the application was not saying that any surname starting with D is fine. The wildcard itself was changing the meaning of the comparison. The difference is subtle but crucial: a partial name is still a guess about the real name, while a wildcard is an instruction to stop caring about the name.
Step 5: read the response
The endpoint was not returning just a booking ID or a success message. It returned passenger information. The response contained fields such as:
{ "passengerList": [ { "birthDate": "[PASSENGER DOB]", "gender": "M", "nationalId": "[NATIONAL ID]", "name": "[PASSENGER NAME]", "surname": "[PASSENGER SURNAME]" } ], "contactPersonSummary": { "email": "[PASSENGER EMAIL]", "phoneNumber": { "countryCode": "[COUNTRY CODE]", "areaCode": "[AREA CODE]", "number": "[PHONE NUMBER]" } }, "pnrInfo": { "pnrNo": "[BOOKING REFERENCE]" }, "ticketNumberList": [ "[TICKET NUMBER]" ]}
This is a JSON response, the answer the server sent back. Line by line:
- The outer
{and}wrap the whole response. "passengerList": [ ... ]is a list of passengers. The square brackets[ ]mean a list, which can hold several entries; here it holds one passenger.- Inside that list, the inner
{ ... }describes one passenger. "birthDate": "[PASSENGER DOB]"is the passenger's date of birth. The text in square brackets is a placeholder: the real value was removed before publishing."gender": "M"is the passenger's gender as recorded in the booking."nationalId": "[NATIONAL ID]"is a national identity number, a government-issued ID."name": "[PASSENGER NAME]"is the passenger's first name."surname": "[PASSENGER SURNAME]"is the passenger's surname."contactPersonSummary": { ... }groups the contact details of the person who made the booking."email": "[PASSENGER EMAIL]"is an email address."phoneNumber": { ... }groups the parts of a phone number:countryCode,areaCodeandnumber, each with a placeholder value."pnrInfo": { "pnrNo": "[BOOKING REFERENCE]" }repeats the booking reference."ticketNumberList": [ "[TICKET NUMBER]" ]is a list of ticket numbers, here with one placeholder entry.
The researcher did not publish the actual passenger information. The response contained full name, surname, date of birth, national ID, email address, phone number, booking information and ticket information, and the only inputs supplied were the booking reference and %.
That last sentence is the heart of the finding. The site was designed to hand over this data only to someone who knew the surname. The researcher knew the booking reference and one character that means "anything".
Why this is more than a search quirk
The behaviour is consistent with the backend building a comparison conceptually similar to:
WHERE surname LIKE :surname
This is a fragment of SQL, the language used to ask a database questions. In plain words:
WHEREstarts a condition: only rows that satisfy it are returned.surnameis the column, the field in the database table that holds surnames.LIKEmeans "match this text against a pattern" rather than "equal this exact text".:surnameis a placeholder where the value supplied by the user is inserted.
In that construct % is not a literal character: it means match zero or more characters. So surname LIKE '%' asks whether the surname contains absolutely anything, which is always true. Every row matches. It is like asking a librarian for "a book whose title contains anything" and being handed the entire shelf.
The application expected % to mean the passenger's surname is %; the database understood it as not caring what the surname is. That gap between what the programmer intended and what the database actually does is the whole bug.
The surname was not merely a search filter. It was acting as a proof-of-ownership factor. The intended flow was:
I know the booking reference +I know the passenger's surname ↓I can access the booking
Read it as before: two things you must know, then access. With the wildcard it became:
I know the booking reference +I know "%" ↓I can access the booking
The second requirement is now something anyone can type. The attacker no longer needs the passenger's actual surname, so the security control is effectively gone. That is why this is an authorization bypass leading to sensitive information disclosure, not just a search that accepts funny characters. The site is not leaking data because it is badly designed on purpose; it is leaking because a permission check was fed a value that changed its meaning.
The older flow without the OTP step
The report also notes that another version of the booking-search flow already had an OTP verification step. Instead of immediately returning passenger information, it could respond with something like:
{ "verificationRequired": true, "passengerList": []}
Line by line:
- The outer braces wrap the response.
"verificationRequired": truemeans "before I show you anything, you must complete a verification step".trueis a yes/no value meaning yes."passengerList": []is an empty list. The square brackets with nothing inside mean no passengers are returned yet.
In other words: nice try, complete verification first. This is the safer design. The OTP is an extra proof that you are the person who owns the booking.
But some older booking-search functionality was still returning the full passenger record without the same protection. The security model of the new flow was OTP followed by passenger PII, while the older flow was booking reference plus surname followed by passenger PII, and with % the surname check was bypassed. The report does not state why the older flow was left in place or how the two flows were routed.
It is like a shop that installs a new alarm on the front door and forgets the back door still has the old lock.
What an attacker could do with it
An attacker who knows a booking reference can retrieve the associated passenger data without knowing the surname. The data returned includes full name, surname, date of birth, national ID, email address, phone number, booking information and ticket information.
The precondition is knowledge of the booking reference. The report does not describe how references might be obtained or how guessable they are, and it does not quantify how many bookings were exposed. What it does show is that the second factor, the surname, added no protection at all once % was accepted.
The outcome
The vulnerability was reported through the bug bounty program. A bug bounty program is a scheme where a company invites outside researchers to report security problems and pays a reward for valid ones. After review, the finding was accepted as High severity and rewarded.

What should change
Based on the root cause, the surname should not be inserted into a LIKE pattern for an authorization decision. It should be compared as a literal value, with wildcard characters escaped (treated as ordinary text) or the query changed to an equality comparison, meaning "the surname must be exactly this". The older booking-search flow should also be brought behind the same OTP verification that the newer flow already uses, so that both paths enforce the same proof-of-ownership step before returning passenger PII.
Other things worth testing
These are variations on the same idea, useful if you ever find a lookup that asks for a reference plus a second piece of information:
- Send
%as the surname on any lookup that pairs a reference with a secondary identifier. A positive result is HTTP 200 with the full record instead of a rejection. - Send
_as the surname. In SQLLIKE,_matches exactly one character, so a positive result is a record returned for a single-character surname. - Send
D%and%ALto confirm pattern semantics rather than prefix matching. A positive result is a record returned for a surname that does not literally equal the input. - Send plain partial values such as
DandDAas controls. A rejection here, alongside acceptance of%, shows the wildcard is changing the comparison rather than the application allowing partial matches. - Look for older or parallel versions of the same lookup flow that lack the OTP step seen on the newer one. A positive result is a response containing passenger PII where the newer flow would return
{"verificationRequired": true, "passengerList": []}. - Check other fields used as ownership factors (date of birth, last four digits of a document, email) for the same pattern behaviour. A positive result is a record returned without the correct literal value.
The lesson
Whenever user input is used as an authorization factor, do not just ask what the application expects. Ask what the backend actually does with it. A form can look strict and still pass your text to a database instruction that gives it a different meaning. Here, all it took was one character.
Glossary
- API: the part of a website that answers requests with data rather than with a web page; the kitchen behind the dining room.
- Authorization bypass: getting past a check that decides whether you are allowed to do something, by making the check itself give the wrong answer.
- Booking reference (PNR): the short code that identifies a booking; PNR stands for passenger name record.
- Bug bounty program: a scheme where a company invites outside researchers to report security problems and pays a reward for valid ones.
- Burp Suite: a tool that sits between your browser and a website so you can read and change the messages exchanged.
- Cached: stored and reused, so an old answer may be shown instead of a fresh one.
- Database: where a website stores its data, like a set of spreadsheets.
- Endpoint: the specific address on a server that handles a particular request.
- HTTP 200: the status code a server sends when the request succeeded and the answer follows.
- JSON: a text format for writing named values in curly braces, used for requests and responses.
LIKE: a SQL instruction that matches text against a pattern instead of an exact value.- OTP (one-time password): a short code, often sent by SMS or email, that you type to prove it is really you.
- Parameter: one named field in a request, such as
surname, with a value attached to it. - PII (personally identifiable information): data that identifies a real person, such as a name, date of birth, national ID, email address or phone number.
- Placeholder: a stand-in value, such as
XXXXXXor[PASSENGER NAME], used where the real value is not published. - Request: the message your browser sends to a server to ask for something.
- Response: the message a server sends back.
- Server: the computer somewhere else that stores the data and answers requests.
- SQL: the language used to ask questions of a database.
- Wildcard: a character with a special meaning in a pattern; in SQL
LIKE,%means "zero or more characters" and_means "exactly one character".