A Developer’s Nightmare: Story of a simple IDOR and some poor fixes worth $1125
An IDOR in a partner portal allowed changing an affiliate ID to add or edit campaigns in other users' accounts, exhausting their paid quota. After the initial fix, the same IDOR was bypassed three times via an embed builder endpoint using path variations.
Published on medium.com
Hello Everyone, I hope you all are doing good. This is my second blog and in this will be covering a finding of a Simple IDOR followed by a series of some poor fixes by the developer.
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 Redacted.com, described in the report as a big media company. Its partners use the subdomain partner.redacted.com to create video and advertisement campaigns. The report covers an access control flaw in that partner portal and, more importantly, a sequence of three incomplete fixes applied to it, each of which the researcher bypassed.
The researcher's stated motivation is worth keeping in mind throughout: going back to previously reported bugs, reproducing them after a fix, and reverse engineering the fix is not wasted time. The report recommends spending 10 to 15 minutes on that exercise.
Setup
The work was done against the partner portal and later against an embed builder subdomain, using ordinary manual testing of requests observed in the browser. The affiliate identifier is sequential, which made the victim's value easy to obtain.
Finding it
While testing for access control issues on the partner portal, the researcher saw a POST request being made to:
https://partner.redacted.com/index.cfm?fuseaction=partner.linkcode
The request carried a JSON body with the following data:
{
"affiliateid":12345,
"campaign_name":"Tester"
}
Because affiliateid is sequential, changing it to another partner's identifier allowed the researcher to add or edit campaigns on anyone's account. The report notes a further consequence: once a campaign has been added, the user cannot remove it. An attacker could therefore populate anyone's available campaign list and exhaust their paid quota.
The original report was filed on 21 December 2021, fixed on 9 December 2021 according to the timeline in the report, and paid a $325 bounty.
When the researcher revisited the issue in March, the fix had removed affiliateid from the JSON body entirely and replaced it with a cookie based authorisation check. That closed the original request. Looking through JavaScript files instead, the researcher found another domain, embed.redacted.com, used to create and preview embedded advertisement campaigns. It offered an option to add new campaigns to the Campaign List, which made it a candidate for the same kind of flaw.
Exploitation
Step 1: the first bypass
The embed builder issued a GET request of the form:
https://embed.redacted.com/builder?affiliateid=[VICTIM_AFFID]&affId=[VICTIM_AFFID_LAST_DIGITS]
Replacing affiliateid with the victim's identifier worked, so the previous fix was bypassed through this embed advertisement builder endpoint. The report records a $300 bounty for this first bypass, reported on 21 March 2022 and fixed on 28 March 2022.

The image shows the $300 bounty awarded for the first bypass.
Step 2: the second bypass
After the first fix, the page was made inaccessible publicly and returned a 403 Forbidden error. The detail that mattered was that the error page was not the server default: it was a custom 403 page containing just the single word "Denied". Connecting the dots, the researcher bypassed the fix within 10 minutes.
The old exploit URL was:
http://embed.redacted.com/builder?affiliateid=[]&affId=[]
Visiting that path returned the 403 Denied page. Appending a / at the end of the path bypassed the fix:
/builder/?affiliateId=[VICTIM_AFFID]&affId=[VICTIM_AFFID_LAST_DIGITS]

The image shows the request with the trailing slash added to the path.
The working exploit URL was:
http://embed.redacted.com/builder/?affiliateid=[]&affId=[]
The report stresses the / at the end of the request. A $250 bounty was awarded for this second bypass, reported on 7 June 2022 and fixed on 13 June 2022.

The image shows the $250 bounty awarded for the second bypass.
Step 3: the third bypass
Two months later the researcher revisited the report again and started from the previous bypass, adding the /. This time it still led to the 403 Forbidden page, but the page was again the custom 403 page with just a Denied message. That told the researcher the builder had not been taken down and that some kind of regex was being used to filter the response. After 20 minutes of trial and error, capitalising the directory name bypassed the fix: changing the endpoint from /builder to /BUILDER/ restored access.

The image shows the capitalised endpoint being used.
The bypassed exploit URL was:
http://embed.redacted.com/BUILDER/?affiliateid=[]&affId=[]

The image shows the $250 bounty awarded for the third bypass.
A $250 bounty was awarded for this third bypass, reported on 2 July 2022 and fixed on 8 July 2022. After that, the controller responsible for the embed builder was completely taken down, so no further bypasses were possible.
Root cause
The original flaw is a straightforward IDOR: the server trusted a client supplied affiliateid in the JSON body of the partner.linkcode request and used it to decide whose campaign list to modify, without checking that the authenticated partner owned that identifier. Sequential identifiers made the victim's value easy to obtain.
The first fix removed the parameter from that request and moved to a cookie based authorisation check, which addressed the original endpoint. The embed builder, however, exposed the same capability through a different request that still accepted affiliateid as a query parameter, so the underlying authorisation decision was still being made from user controlled input on that path.
The second and third fixes were filtering measures rather than removal of the vulnerable functionality. The custom 403 page with a single "Denied" message is the tell: a default server error would suggest the route was gone, while a bespoke page suggests the application was still processing the request and rejecting it based on some pattern. The trailing slash bypass shows that appending a / to the path got past the fix. The capitalisation bypass shows that changing /builder to /BUILDER/ got past the second fix. The report describes the mechanism as "some kind of regex" used to filter the response.
Impact
With the original IDOR, an attacker with a partner account could add or edit campaigns on any other partner's account by changing a sequential affiliateid. Because campaigns cannot be removed by the user once added, the attacker could populate a victim's available campaign list and exhaust their paid quota. The same capability was reachable through the embed builder endpoint across all three bypasses, until the controller was taken down. The report does not quantify the number of affected partners or describe any other data exposed.
Fix
The report describes the fixes as they were applied: removal of affiliateid from the JSON body and a cookie based authorisation check on the original endpoint; then, after each bypass, further filtering of the embed builder path.
Read as a lesson, the durable fix is to enforce authorisation on the server against the authenticated identity rather than against any identifier supplied by the client, and to apply that check consistently across every endpoint that exposes the same capability, including preview and embed builders. Path based filtering is not an authorisation control: normalise the path (trailing slashes, case, encoding) before any matching, and prefer removing or properly protecting the route over pattern matching it.
Variants to test
- Sibling endpoints for the same capability. When a parameter is removed from one request after a report, enumerate JavaScript files for other hosts and paths that perform the same action. A positive result is a request on another subdomain that still accepts the identifier and returns or modifies the victim's data.
- Custom error pages as a signal. Send the previously blocked path and inspect the error. A bespoke page (here, a single word "Denied") rather than a framework default suggests filtering in front of a live route. A positive result is any path variation that returns the normal page instead of the custom error.
- Trailing slash and path normalisation. Try
/builder/,//builder,/builder/., and encoded variants against a path that returns 403. A positive result is the functional page loading with the victim's identifier. - Case variation. Try
/BUILDER/,/Builder/, and mixed case on any path protected by pattern matching. A positive result is the same as above, which indicates a case sensitive filter over a case insensitive route. - Parameter name and placement variation. Where a parameter was removed from a JSON body, try it as a query parameter, in a different casing (
affiliateIdversusaffiliateid), or in a nested object. A positive result is the server honouring the supplied value over the session identity. - Sequential identifier enumeration. Where identifiers are numeric and sequential, test whether the server checks ownership at all by requesting a neighbouring identifier. A positive result is another account's data or a successful write to it.
What happened, in plain words
A security researcher found a bug in a big media company's website. The bug let one partner account change another partner's advertising campaigns just by changing a number in a request. The company fixed it, but the fix was incomplete. The researcher came back, found the same problem reachable through a different page, and got paid again. The company fixed that too, again incompletely. This happened three times in total, and the researcher earned $1125 in all.
The story is less about the original bug, which is simple, and more about the fixes. Each fix was bypassed by a small variation on the request. The researcher's point is that going back to your old reports, reproducing the issue after a fix, and working out how the fix was built is time well spent. The report suggests spending 10 to 15 minutes on that exercise.
Before the technical detail, a few ideas from zero, because everything below depends on them.
- A request is what your browser sends to a website when you click something or a page loads. It is a message asking the server to do something or give you something back. You can see these messages in your browser's developer tools, on the Network tab.
- An API is the part of a website that accepts these requests and answers them with data rather than a finished web page. 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 tell the waiter what you want, and the waiter carries it back. Websites work the same way: your browser asks, the server answers.
- A parameter is a named value attached to a request, like a form field. In a web address, parameters come after a
?and look likename=value, with&between them. In a JSON body, they are the named fields inside the curly braces. - JSON is a plain text format for structured data, using curly braces for objects and
"name": valuepairs. It is just a way of writing down labelled values so a program can read them. - A cookie is a small piece of data your browser stores for a website and sends back with every request to that site. It is how a site remembers who you are between page loads. Think of it as the wristband you get at an event: you show it at the door and you are let in without proving who you are again.
- Authorisation is the decision about whether the person making a request is allowed to do the thing they are asking for. Authentication is proving who you are; authorisation is checking what you are allowed to do. A wristband proves you are at the event; authorisation is whether that wristband lets you into the backstage area.
- An identifier is a number or string that names a specific record, such as a customer number or an account number. If identifiers are sequential (1, 2, 3, 4...), anyone can guess the next one.
- IDOR stands for Insecure Direct Object Reference. It means the server takes an identifier supplied by the user and uses it to decide which record to act on, without checking that the user is allowed to touch that record. In everyday terms: a hotel clerk hands you the key to room 305 because you asked for room 305, without checking that you are the guest in room 305. The room number is the direct object reference; the missing check is the insecurity.
- A 403 Forbidden error is the server's way of saying "I understood your request, but you are not allowed to do this." It is different from a 404 Not Found, which says "there is nothing here."
- A regex (regular expression) is a pattern used to match text. A filter built on a regex checks whether a piece of text, such as a URL path, matches a pattern, and blocks it if it does. It is like a bouncer with a list of names: if your name is on the list, you do not get in, but a slightly different spelling of your name might slip past.
- A controller is the piece of server code that handles a particular request and decides what to do with it. Taking the controller down means removing the code that answers that request, so the request has nowhere to go.
The target and the original bug
The target is a big media company, referred to in the report as Redacted.com. Its partners use the subdomain partner.redacted.com to create video and advertisement campaigns. A subdomain is a section of a website with its own name in front of the main domain, like a department inside a company.
While testing for access control issues on the partner portal, the researcher saw a POST request being made to:
https://partner.redacted.com/index.cfm?fuseaction=partner.linkcode
Line by line:
https://is the secure version of the protocol browsers use to talk to websites.partner.redacted.comis the subdomain, the partner portal./index.cfmis the page or script being requested. The.cfmending is part of the script name in the URL.?fuseaction=partner.linkcodeis a parameter calledfuseactionwith the valuepartner.linkcode. It tells the server which action inside that script to run. Think of it as choosing an option from a menu: the script is the restaurant,fuseactionis the dish you ordered.
A POST request is one that sends data to the server to create or change something, as opposed to a GET request, which asks for something to be shown. The request carried a JSON body with the following data:
{
"affiliateid":12345,
"campaign_name":"Tester"
}
Line by line:
- The outer curly braces mark the start and end of a single JSON object, a bundle of named values.
"affiliateid":12345is a field namedaffiliateidwith the value12345. This is the identifier of the partner account the request is about. The name suggests an affiliate, a partner who promotes the company's content."campaign_name":"Tester"is a field namedcampaign_namewith the valueTester, the name to give the new campaign.
Because affiliateid is sequential, changing it to another partner's identifier allowed the researcher to add or edit campaigns on anyone's account. This is the IDOR: the server read the number from the request and acted on that account, without checking that the person sending the request owned that number. The researcher did not need to break any password or encryption; the number was simply trusted.
The report notes a further consequence: once a campaign has been added, the user cannot remove it. An attacker could therefore populate anyone's available campaign list and exhaust their paid quota. In plain terms, the victim's account has a limited number of campaign slots, and the attacker can fill them with junk that the victim cannot delete, so the victim can no longer use the slots they paid for.
The original report was filed on 21 December 2021, fixed on 9 December 2021 according to the timeline in the report, and paid a $325 bounty. A bounty is the payment a company makes to a researcher who reports a valid security problem.
Coming back to it
When the researcher revisited the issue in March, the fix had removed affiliateid from the JSON body entirely and replaced it with a cookie based authorisation check. That closed the original request: the server no longer took the account number from the body, and instead looked at the cookie to decide who was asking. The wristband, not the name you wrote on the form, decided which room you got.
Looking through JavaScript files instead, the researcher found another domain, embed.redacted.com, used to create and preview embedded advertisement campaigns. JavaScript files are the code your browser downloads and runs to make a page interactive; reading them is a way of finding other pages and requests a site uses, including ones you would not see by clicking around. The embed builder offered an option to add new campaigns to the Campaign List, which made it a candidate for the same kind of flaw: same capability, different door.
Step 1: the first bypass
The embed builder issued a GET request of the form:
https://embed.redacted.com/builder?affiliateid=[VICTIM_AFFID]&affId=[VICTIM_AFFID_LAST_DIGITS]
Line by line:
https://embed.redacted.comis the embed builder subdomain./builderis the path, the page that builds an embedded campaign.?starts the list of parameters.affiliateid=[VICTIM_AFFID]is the partner account identifier. The square brackets are placeholders in the report, standing in for the victim's actual number.&separates the next parameter.affId=[VICTIM_AFFID_LAST_DIGITS]is a second parameter, apparently the last digits of the same identifier. The report does not explain why the page takes both.
Replacing affiliateid with the victim's identifier worked, so the previous fix was bypassed through this embed advertisement builder endpoint. The original door had been locked, but this second door led to the same room and was still open. The report records a $300 bounty for this first bypass, reported on 21 March 2022 and fixed on 28 March 2022.

The image shows the $300 bounty awarded for the first bypass.
Step 2: the second bypass
After the first fix, the page was made inaccessible publicly and returned a 403 Forbidden error. The detail that mattered was that the error page was not the server default: it was a custom 403 page containing just the single word "Denied".
Why does that matter? A default error page is what the server produces when it has nothing specific to say, like a generic "page not found" from the web server software itself. A custom page with a single word means someone wrote code to produce that page. That code runs when a request reaches the application and the application decides to refuse it. So the route was still there and still being processed; it was being filtered rather than removed. The researcher inferred this and bypassed the fix within 10 minutes.
The old exploit URL was:
http://embed.redacted.com/builder?affiliateid=[]&affId=[]
Line by line:
http://is the unencrypted version of the protocol.embed.redacted.com/builderis the same path as before, with no trailing slash.affiliateid=[]andaffId=[]are the two parameters, with the values left as empty placeholders in the report.
Visiting that path returned the 403 Denied page. Appending a / at the end of the path bypassed the fix:
/builder/?affiliateId=[VICTIM_AFFID]&affId=[VICTIM_AFFID_LAST_DIGITS]
Line by line:
/builder/is the same path with a slash added at the end. To a human,/builderand/builder/look like the same place. To a filter matching the exact text/builder, they are different strings, and only one of them matches.?affiliateId=[VICTIM_AFFID]is the identifier parameter. Note the capitalIinaffiliateIdhere, as it appears in the report.&affId=[VICTIM_AFFID_LAST_DIGITS]is the second parameter.

The image shows the request with the trailing slash added to the path.
The working exploit URL was:
http://embed.redacted.com/builder/?affiliateid=[]&affId=[]
Line by line:
- This is the same as the old exploit URL, with the
/added afterbuilder. - The parameters are unchanged.
The report stresses the / at the end of the request. A $250 bounty was awarded for this second bypass, reported on 7 June 2022 and fixed on 13 June 2022.

The image shows the $250 bounty awarded for the second bypass.
Step 3: the third bypass
Two months later the researcher revisited the report again and started from the previous bypass, adding the /. This time it still led to the 403 Forbidden page, but the page was again the custom 403 page with just a Denied message. That told the researcher the builder had not been taken down and that some kind of regex was being used to filter the response. The report describes the mechanism as "some kind of regex".
After 20 minutes of trial and error, capitalising the directory name bypassed the fix: changing the endpoint from /builder to /BUILDER/ restored access.

The image shows the capitalised endpoint being used.
The bypassed exploit URL was:
http://embed.redacted.com/BUILDER/?affiliateid=[]&affId=[]
Line by line:
http://embed.redacted.com/BUILDER/is the same path with the directory name in capitals and the trailing slash kept.?affiliateid=[]&affId=[]are the same two parameters.
Why does capitalisation work? Web addresses are, by convention, case sensitive in their path portion, but many servers and frameworks treat paths case insensitively when routing a request to code. So /BUILDER/ can reach the same controller as /builder/. A filter that matches the lowercase pattern /builder/ will not match /BUILDER/, and the request passes through to the code that was supposed to be protected. It is like a bouncer checking names against a list written in lowercase: show up as JOHN and the list check fails, but the door still opens.

The image shows the $250 bounty awarded for the third bypass.
A $250 bounty was awarded for this third bypass, reported on 2 July 2022 and fixed on 8 July 2022. After that, the controller responsible for the embed builder was completely taken down, so no further bypasses were possible. Removing the code that answers the request is the one fix that leaves nothing to bypass.
Why it kept happening
The original flaw is a straightforward IDOR: the server trusted a client supplied affiliateid in the JSON body of the partner.linkcode request and used it to decide whose campaign list to modify, without checking that the authenticated partner owned that identifier. Sequential identifiers made the victim's value easy to obtain.
The first fix removed the parameter from that request and moved to a cookie based authorisation check, which addressed the original endpoint. The embed builder, however, exposed the same capability through a different request that still accepted affiliateid as a query parameter, so the underlying authorisation decision was still being made from user controlled input on that path. The fix covered one door and left the other open.
The second and third fixes were filtering measures rather than removal of the vulnerable functionality. The custom 403 page with a single "Denied" message is the tell: a default server error would suggest the route was gone, while a bespoke page suggests the application was still processing the request and rejecting it based on some pattern. The trailing slash bypass shows that appending a / to the path got past the fix. The capitalisation bypass shows that changing /builder to /BUILDER/ got past the second fix.
What an attacker could do
With the original IDOR, an attacker with a partner account could add or edit campaigns on any other partner's account by changing a sequential affiliateid. Because campaigns cannot be removed by the user once added, the attacker could populate a victim's available campaign list and exhaust their paid quota. The same capability was reachable through the embed builder endpoint across all three bypasses, until the controller was taken down. The report does not quantify the number of affected partners or describe any other data exposed.
How it was fixed, and what a durable fix looks like
The report describes the fixes as they were applied: removal of affiliateid from the JSON body and a cookie based authorisation check on the original endpoint; then, after each bypass, further filtering of the embed builder path.
Read as a lesson, the durable fix is to enforce authorisation on the server against the authenticated identity rather than against any identifier supplied by the client, and to apply that check consistently across every endpoint that exposes the same capability, including preview and embed builders. Path based filtering is not an authorisation control: normalise the path (trailing slashes, case, encoding) before any matching, and prefer removing or properly protecting the route over pattern matching it. In everyday terms: check the wristband at every door to the backstage area, not just the first one, and do not rely on a list of forbidden door names that a different spelling can slip past.
Variants to test
- Sibling endpoints for the same capability. When a parameter is removed from one request after a report, enumerate JavaScript files for other hosts and paths that perform the same action. A positive result is a request on another subdomain that still accepts the identifier and returns or modifies the victim's data.
- Custom error pages as a signal. Send the previously blocked path and inspect the error. A bespoke page (here, a single word "Denied") rather than a framework default suggests filtering in front of a live route. A positive result is any path variation that returns the normal page instead of the custom error.
- Trailing slash and path normalisation. Try
/builder/,//builder,/builder/., and encoded variants against a path that returns 403. A positive result is the functional page loading with the victim's identifier. - Case variation. Try
/BUILDER/,/Builder/, and mixed case on any path protected by pattern matching. A positive result is the same as above, which indicates a case sensitive filter over a case insensitive route. - Parameter name and placement variation. Where a parameter was removed from a JSON body, try it as a query parameter, in a different casing (
affiliateIdversusaffiliateid), or in a nested object. A positive result is the server honouring the supplied value over the session identity. - Sequential identifier enumeration. Where identifiers are numeric and sequential, test whether the server checks ownership at all by requesting a neighbouring identifier. A positive result is another account's data or a successful write to it.
Glossary
- API: the part of a website that accepts requests and answers with data rather than a finished page; the waiter between your browser and the server.
- Authorisation: the decision about whether the person making a request is allowed to do what they are asking.
- Authentication: proving who you are, as opposed to what you are allowed to do.
- Bounty: the payment a company makes to a researcher who reports a valid security problem.
- Campaign: an advertising or video promotion created and managed by a partner in this report's product.
- Controller: the piece of server code that handles a particular request and decides what to do with it.
- Cookie: a small piece of data your browser stores for a site and sends back with every request, used to remember who you are.
- Custom error page: an error page written by the application itself rather than produced by the web server software by default.
- GET request: a request that asks the server to show or return something.
- IDOR (Insecure Direct Object Reference): a flaw where the server takes an identifier supplied by the user and acts on that record without checking the user is allowed to touch it.
- Identifier: a number or string naming a specific record, such as an account number.
- JSON: a plain text format for structured data using curly braces and
"name": valuepairs. - Parameter: a named value attached to a request, either after
?in a URL or as a field in a JSON body. - Path: the part of a URL after the domain, such as
/builder, naming the page or route being requested. - POST request: a request that sends data to the server to create or change something.
- Query parameter: a parameter placed in the URL after the
?. - Regex (regular expression): a pattern used to match text, often used in filters to block strings that match the pattern.
- Request: the message your browser sends to a website asking it to do something or return something.
- Route: the mapping between a URL path and the code that handles it.
- Sequential identifier: an identifier that increases by one each time, making other values easy to guess.
- Subdomain: a section of a website with its own name in front of the main domain, such as
partner.redacted.com. - 403 Forbidden: the server's response meaning it understood the request but the requester is not allowed to do it.
- 404 Not Found: the server's response meaning there is nothing at the requested address.