interesting Logic idor that allowed me to Access User Data and Private Photos
The application used a 12-digit OwnerId to identify photo owners, and the share endpoint accepted an OwnerId without checking that it belonged to the caller. Because OwnerIds were derived from the email username and only two middle digits varied, an attacker could create an account with an email alias, predict a victim's OwnerId, and share or access the victim's private photos.
Published on hamzadzworm.medium.com
I was working on a private program that allows users to upload private photos. Every user has an ID called “OwnerId” consisting of 12 digits, which makes it very hard to brute-force.
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 private bug bounty program whose application lets users upload private photos. Each user is identified by a 12-digit value called OwnerId, which the application uses as the identifier for accessing and sharing photos. A 12-digit space is large enough that guessing an identifier directly is impractical, so the design relies on the value being unguessable.
The feature under examination is photo sharing: an API endpoint that shares photos and takes an OwnerId and an email address as parameters. The report does not name the endpoint, the host, or the request method.
Setup
The researcher created several accounts using different temporary email addresses. The first observation was that the application did not verify email addresses, so an account could be created with any email address and used straight away.
No tools or versions are named in the report. The only precondition that matters for the attack is the missing email verification, because it lets an attacker register an address that is a variant of the victim's address.
Finding it
After creating multiple accounts, the researcher compared the OwnerId values and saw a pattern: every account started with a specific 9-digit sequence while the last 3 digits stayed the same.

To look for an IDOR, the researcher uploaded photos to two different accounts and analysed the requests used to share photos.

One of those requests stood out: the sharing endpoint accepted an OwnerId and an email address as parameters.

Passing a user-controlled identifier into an action that operates on another user's data is exactly the shape of an IDOR, so the next step was to confirm it.
Exploitation
Step 1: confirm the IDOR on the sharing endpoint
With photos uploaded to two accounts, the researcher took the OwnerId of Account 2 (the victim) and supplied it while performing the share action from Account 1 (the attacker). The application shared the photos belonging to Account 2, which confirmed the IDOR.

The image shows the victim's photo being shared by the attacker's account.
Step 2: work out how OwnerId is generated
The remaining problem was obtaining another user's 12-digit OwnerId. The researcher set this aside and kept creating accounts, this time using email aliases, meaning addresses that start with the same email name. With aliases, the first 7 digits of the OwnerId became identical.

The conclusion was that the leading digits are derived from the first part of the email address, while the last 3 digits stay the same. That leaves only two digits in the middle to brute-force. The researcher's illustration:
john = 1234567(00)890
john+1 = 1234567(12)890
john+2 = 1234567(14)890
So the structure is: a prefix derived from the email username, two middle digits, and a fixed 3-digit suffix.
Step 3: predict the victim's OwnerId
If the victim's email is [redacted], the attacker registers [redacted]. Because there is no email verification, the attacker can log in directly with that address. The new account receives the same first 7 digits as the victim's OwnerId; only the two middle digits differ and have to be brute-forced.

Step 4: enumerate the middle digits and access private photos
With the prefix known and the suffix fixed, the attacker enumerates the two middle digits and submits candidate OwnerId values to the sharing endpoint. A correct value shares the victim's private photos with the attacker's account.


The vulnerability turns what should be an unguessable 12-digit identifier into a predictable value that can be enumerated with minimal effort, resulting in an IDOR and unauthorised access to users' private photos.
Root cause
Two design mistakes combine here.
- The sharing endpoint accepts an
OwnerIdfrom the request and acts on it, rather than taking the owner from the authenticated session. That is the IDOR itself: authorisation is decided by a client-supplied identifier. - The
OwnerIdis derived from the user's email address in a predictable way: the leading digits come from the email username, the last 3 digits are constant, and only two middle digits vary. An identifier that is supposed to be unguessable is therefore partly known to anyone who knows or can guess the victim's email address.
The missing email verification removes the last obstacle. Without it, an attacker can register an alias of the victim's address, obtain an account whose OwnerId shares the victim's prefix, and log in immediately.
Impact
An attacker who knows or can guess a victim's email address can derive most of the victim's OwnerId, brute-force the remaining two digits, and use the sharing endpoint to share the victim's private photos to the attacker's own account. The report frames the outcome as unauthorised access to users' private photos.
The attack depends on the missing email verification, on the victim's email address being known or guessable, and on the predictable construction of OwnerId. The report does not state how many users were affected or whether the program assigned a severity or paid a bounty.
Fix
Based on the root cause, the fixes would be:
- Stop trusting the
OwnerIdsupplied in the request. Derive the acting user from the authenticated session and check that the session user is authorised to share the referenced photos. - Replace the predictable
OwnerIdwith a random identifier that does not encode the email address, so that knowing an email gives no information about the identifier. - Enforce email verification at registration, so an attacker cannot claim an alias of a victim's address.
Variants to test
- Client-supplied owner identifiers on object actions. Look for endpoints that take an owner, account or user identifier alongside an object identifier. A positive result is the action succeeding on another account's object when you send your session with their identifier.
- Identifiers derived from email or username. Register two aliases of the same address and compare the resulting identifiers. A positive result is a shared prefix with a small varying portion.
- Missing email verification. Register with an address you do not control and log in. A positive result is full access without any confirmation step, which enables alias-based attacks.
- Alias registration against a known victim address. Register
victim+1@domainand compare the new identifier with what you can infer about the victim's. A positive result is a matching prefix that narrows the brute-force space. - Small varying portions in identifiers. Where only a few digits vary, enumerate them against an endpoint that reveals whether the identifier is valid. A positive result is a hit within a small number of requests.
Hunting notes
This kind of bug tends to hide in features that act on another user's objects: sharing, transferring, inviting, exporting. The signal during recon is an endpoint whose parameters include both an object reference and an owner or user reference, especially when the owner value looks structured rather than random.
A second signal is registration without email verification, which makes alias-based attacks practical. Comparing identifiers across accounts you create, particularly with aliases of the same address, quickly shows whether the value is derived from the email and how much of it is fixed.
The researcher demonstrated impact by sharing a victim account's private photos from an attacker account and showing the result.
What happened, in plain words
A researcher found a way to look at other people's private photos on a website. The website let people upload photos and keep them private. Each person on the site had a hidden number, called an OwnerId, made of 12 digits. The site used that number to decide whose photos were whose. Twelve digits is a lot of possibilities, so the site's designers assumed nobody could guess someone else's number.
Two things went wrong. First, the part of the site that shares photos trusted whatever OwnerId the browser sent, instead of checking who was actually logged in. That is the classic shape of an IDOR (Insecure Direct Object Reference): the site hands you a key and believes you when you say which door it opens. Second, the 12-digit number was not random at all. It was built from the person's email address in a predictable way, so most of it could be worked out just by knowing the email.
A third weakness made the whole thing practical: the site never checked that an email address really belonged to the person signing up. That meant the researcher could register an address that was a small variation of the victim's address, get a number that shared most of the victim's digits, and then try the few remaining possibilities until one worked. The result was unauthorised access to users' private photos.
Background: the product and the feature
The target was a private bug bounty program. A bug bounty program is an arrangement where a company invites independent researchers to test its systems and report security problems, usually in exchange for a reward. "Private" means only invited researchers can take part, and the details are not public.
The application lets users upload private photos. Each user is identified by a 12-digit value called OwnerId. The application uses this value as the identifier for accessing and sharing photos. Because 12 digits give a very large number of possible values, guessing an identifier directly is impractical, so the design relies on the value being unguessable.
The feature under examination is photo sharing. It is handled by an API endpoint: a specific address on the server that the browser (or an app) sends a request to when you click something like "share". An API (Application Programming Interface) is simply the set of these addresses and the rules for talking to them. Think of a restaurant: the menu and the waiter are the API, the kitchen is the server, and you never walk into the kitchen yourself. This particular endpoint takes an OwnerId and an email address as parameters. A parameter is a named piece of information sent along with a request, like a field on a form.
The report does not name the endpoint, the host, or the request method.
Setting up accounts
The researcher created several accounts using different temporary email addresses. A temporary email address is a disposable inbox you can create in seconds and throw away, useful when a site asks for an email but you do not want to use your real one.
The first observation was that the application did not verify email addresses. Email verification is the step where a site sends a link or code to the address you typed and asks you to click or enter it, proving the inbox is yours. Without it, an account could be created with any email address and used straight away.
No tools or versions are named in the report. The only precondition that matters for the attack is the missing email verification, because it lets an attacker register an address that is a variant of the victim's address.
Finding the pattern
After creating multiple accounts, the researcher compared the OwnerId values and saw a pattern: every account started with a specific 9-digit sequence while the last 3 digits stayed the same.

To look for an IDOR, the researcher uploaded photos to two different accounts and analysed the requests used to share photos. Analysing a request means opening the browser's developer tools, the built-in panel that shows everything the browser sends and receives, and reading the traffic when you click a button. It is the equivalent of watching the waiter carry your order to the kitchen instead of just seeing the plate arrive.

One of those requests stood out: the sharing endpoint accepted an OwnerId and an email address as parameters.

Passing a user-controlled identifier into an action that operates on another user's data is exactly the shape of an IDOR, so the next step was to confirm it. "User-controlled" means the value comes from the browser, so the person using the browser can change it before sending. If the server acts on that value without checking whether the logged-in user is allowed to touch that object, the door is open.
Exploitation
Step 1: confirm the IDOR on the sharing endpoint
With photos uploaded to two accounts, the researcher took the OwnerId of Account 2 (the victim) and supplied it while performing the share action from Account 1 (the attacker). The application shared the photos belonging to Account 2, which confirmed the IDOR.

The image shows the victim's photo being shared by the attacker's account. The authenticated session is the server's memory of who you are after you log in, usually kept with a cookie or token: a small piece of data your browser stores and sends back with every request, like a wristband at an event that proves you paid to get in. The server should have looked at the wristband to decide whose photos these are, not at the number written on the request.
Step 2: work out how OwnerId is generated
The remaining problem was obtaining another user's 12-digit OwnerId. The researcher set this aside and kept creating accounts, this time using email aliases. An email alias is a variation of an address that still belongs to the same inbox: many email providers treat name+anything@domain as the same mailbox as name@domain. The + part is ignored for delivery but kept as part of the address text, so a site sees a different address while the mail still lands in the same place.
With aliases, the first 7 digits of the OwnerId became identical.

The conclusion was that the leading digits are derived from the first part of the email address, while the last 3 digits stay the same. That leaves only two digits in the middle to brute-force. Brute-force means trying every possibility in turn until one works, like working through a combination lock one number at a time. The researcher's illustration:
john = 1234567(00)890
john+1 = 1234567(12)890
john+2 = 1234567(14)890
Reading this line by line:
john = 1234567(00)890shows theOwnerIdproduced for the plain addressjohn. The first seven digits,1234567, come from the email username. The last three,890, are the same for everyone. The two digits in brackets,00, are the part that varies.john+1 = 1234567(12)890shows theOwnerIdfor the aliasjohn+1. The first seven digits are unchanged because the username part is stilljohn. The last three are unchanged. Only the two middle digits moved, to12.john+2 = 1234567(14)890shows the same forjohn+2: same prefix, same suffix, and the middle digits are now14.
So the structure is: a prefix derived from the email username, two middle digits, and a fixed 3-digit suffix. The brackets are the researcher's way of marking the only part that is not already known.
Step 3: predict the victim's OwnerId
If the victim's email is [redacted], the attacker registers [redacted]. Because there is no email verification, the attacker can log in directly with that address. The new account receives the same first 7 digits as the victim's OwnerId; only the two middle digits differ and have to be brute-forced.

Why this step matters: the attacker never needs to see the victim's OwnerId. They only need to know the victim's email address, which is often public or easy to guess, and then create an account that is a near-copy of it. The site hands back a number that is almost the victim's number, and the missing part is tiny.
Step 4: enumerate the middle digits and access private photos
With the prefix known and the suffix fixed, the attacker enumerates the two middle digits and submits candidate OwnerId values to the sharing endpoint. Enumerating means going through a list in order, here the values 00 to 99, one request at a time. A correct value shares the victim's private photos with the attacker's account.


The vulnerability turns what should be an unguessable 12-digit identifier into a predictable value that can be enumerated with minimal effort, resulting in an IDOR and unauthorised access to users' private photos.
Root cause
Two design mistakes combine here.
- The sharing endpoint accepts an
OwnerIdfrom the request and acts on it, rather than taking the owner from the authenticated session. That is the IDOR itself: authorisation is decided by a client-supplied identifier. Authorisation is the check that decides whether the person making a request is allowed to do what they are asking. Here the check was effectively "does the number in the request match the photos?", which anyone can satisfy by sending the right number. - The
OwnerIdis derived from the user's email address in a predictable way: the leading digits come from the email username, the last 3 digits are constant, and only two middle digits vary. An identifier that is supposed to be unguessable is therefore partly known to anyone who knows or can guess the victim's email address.
The missing email verification removes the last obstacle. Without it, an attacker can register an alias of the victim's address, obtain an account whose OwnerId shares the victim's prefix, and log in immediately. Rate limiting is a server rule that caps how many requests you can make in a period, which would have made trying 100 values slow or blocked.
Impact
An attacker who knows or can guess a victim's email address can derive most of the victim's OwnerId, brute-force the remaining two digits, and use the sharing endpoint to share the victim's private photos to the attacker's own account. The report frames the outcome as unauthorised access to users' private photos.
The attack depends on the missing email verification, on the victim's email address being known or guessable, and on the predictable construction of OwnerId. The report does not state how many users were affected or whether the program assigned a severity or paid a bounty.
Fix
Based on the root cause, the fixes would be:
- Stop trusting the
OwnerIdsupplied in the request. Derive the acting user from the authenticated session and check that the session user is authorised to share the referenced photos. - Replace the predictable
OwnerIdwith a random identifier that does not encode the email address, so that knowing an email gives no information about the identifier. - Enforce email verification at registration, so an attacker cannot claim an alias of a victim's address.
Variants to test
- Client-supplied owner identifiers on object actions. Look for endpoints that take an owner, account or user identifier alongside an object identifier. A positive result is the action succeeding on another account's object when you send your session with their identifier.
- Identifiers derived from email or username. Register two aliases of the same address and compare the resulting identifiers. A positive result is a shared prefix with a small varying portion.
- Missing email verification. Register with an address you do not control and log in. A positive result is full access without any confirmation step, which enables alias-based attacks.
- Alias registration against a known victim address. Register
victim+1@domainand compare the new identifier with what you can infer about the victim's. A positive result is a matching prefix that narrows the brute-force space. - Small varying portions in identifiers. Where only a few digits vary, enumerate them against an endpoint that reveals whether the identifier is valid. A positive result is a hit within a small number of requests.
Hunting notes
This kind of bug tends to hide in features that act on another user's objects: sharing, transferring, inviting, exporting. The signal during recon is an endpoint whose parameters include both an object reference and an owner or user reference, especially when the owner value looks structured rather than random. Recon (reconnaissance) is the early phase of testing where you map out what the application does and how it talks to its server.
A second signal is registration without email verification, which makes alias-based attacks practical. Comparing identifiers across accounts you create, particularly with aliases of the same address, quickly shows whether the value is derived from the email and how much of it is fixed.
The researcher demonstrated impact by sharing a victim account's private photos from an attacker account and showing the result.
Glossary
- API: the set of addresses and rules a browser or app uses to talk to a server, like a menu and waiter in a restaurant.
- API endpoint: one specific address on the server that handles one kind of request, such as sharing a photo.
- Authenticated session: the server's memory of who you are after you log in, usually carried by a cookie or token.
- Authorisation: the check that decides whether the person making a request is allowed to do what they are asking.
- Brute-force: trying every possible value in turn until one works.
- Bug bounty program: an arrangement where a company invites independent researchers to test its systems and report security problems, often for a reward.
- Cookie: a small piece of data a website stores in your browser and receives back with each request, often used to remember who you are.
- Email alias: a variation of an email address, such as
name+1@domain, that still delivers to the same inbox. - Email verification: the step where a site sends a link or code to an address to prove the inbox belongs to the person signing up.
- Enumerate: to go through a list of values in order, one request at a time.
- IDOR (Insecure Direct Object Reference): a flaw where a site uses an identifier supplied by the browser to decide which object to act on, without checking that the logged-in user is allowed to touch that object.
- OwnerId: the 12-digit value the application uses to identify which user owns a set of photos.
- Parameter: a named piece of information sent along with a request, like a field on a form.
- Rate limiting: a server rule that caps how many requests can be made in a period.
- Recon (reconnaissance): the early phase of testing where you map out what an application does and how it talks to its server.
- Token: a piece of data, similar in role to a cookie, that proves to the server who you are.
- Temporary email address: a disposable inbox that can be created quickly and thrown away.
- User-controlled: a value that comes from the browser, so the person using the browser can change it before sending.