Skip to content
Business logic Write-up Beginner

How I found the silliest logical vulnerability for $750 that no one found for 3 years

A plugin's email blacklist check used a case-sensitive comparison, so an attacker could bypass the restriction by changing the domain's case (e.g., GMAIL.com instead of gmail.com). This allowed registration with email addresses from blacklisted free-mail domains.

Sina Kheirkhah Follow

Published on sinsinology.medium.com

Bounty$750total stated by author View original

Sometimes even a well-tested program can have silly vulnerabilities, such as this one, a private program which I was invited and it was tested for 3 years, lots of lots of vulnerabilities even critical ones were reported, from SQL-i to XSS, Deserialization and whatnot, nobody reported a vulnerability for over 1 year…

Sina Kheirkhah (SinSin), on sinsinology.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

This is a write-up about a private bug bounty program that the researcher was invited to. The program had been running for three years and had received many reports, including critical ones such as SQL injection, XSS and deserialisation. According to the author, nobody had reported a vulnerability for over a year before he spent three days on the target and found this bug.

The target was a plugin rather than the main application. The program explicitly stated that vulnerabilities in its plugins were in scope. The plugin was open-source, which let the researcher read the source directly instead of probing it as a black box.

The feature involved is an email blacklist. The plugin introduced a mechanism to prevent registration with free mailing services such as temporary mail providers, Gmail, Yahoo and similar. The typical implementation keeps a list of known free-mail domains and rejects a registration when the domain part of the submitted email address matches an entry on that list. For example, [redacted] would be rejected because gmail.com is blacklisted.

The weakness class is a logic flaw: an email blacklist bypass.

Setup

There were no special accounts, roles or tooling described. The key precondition was access to the plugin source code, which was open-source. The researcher read through it to check for implementation flaws rather than testing the feature blindly. The only input needed to exercise the flaw is an email address submitted to the registration or validation flow that performs the blacklist check.

Finding it

While reading the source, the researcher came across a subroutine that performed the domain check. The code takes the user's email address, for example [redacted], extracts the domain part, and checks whether that domain appears on the blacklist. The author notes that submitting an address whose domain is simply not on the blacklist is not a bypass at all; a bypass only exists if a restricted domain is accepted.

The flaw is in how the membership check is written. The application uses PHP's in_array function, which performs a case-sensitive comparison. Because of that, the domain comparison can be defeated by changing the case of the domain: [redacted] becomes [redacted], and the in_array call returns false when checking whether the domain is blacklisted. The in_array call returns false when checking whether the domain is blacklisted.

Exploitation

Step 1: Submit a blacklisted domain in its normal form

Register or validate with an address on a restricted domain, for example:

Text
[redacted]

Step 2: Change the case of the domain part

Submit the same address with the domain in a different case:

Text
[redacted]

The domain part is now GMAIL.com. The in_array comparison is case-sensitive, so it does not match the lowercase gmail.com entry on the blacklist and returns false. The in_array comparison does not match the lowercase blacklist entry and returns false.

No request or response captures are shown in the report; the demonstration is the source-level behaviour of the check together with the two address forms above.

Root cause

The blacklist lookup relies on PHP's in_array, which compares strings case-sensitively. Domain names are case-insensitive by definition, so gmail.com, GMAIL.com and Gmail.com all refer to the same provider. The code normalises neither side of the comparison: it does not lowercase the extracted domain before the lookup, and it does not use a case-insensitive comparison. Any casing variation of a blacklisted domain therefore fails to match and passes the check.

The existing defence, the blacklist itself, was never bypassed at the data level: the restricted domain was on the list all along. The check simply did not recognise it in a different case. Because the plugin was open-source, the flaw was visible in the source, but the report gives no indication that it had been found by testing during the preceding three years.

Impact

The bypass defeats the check that is meant to block addresses from restricted domains such as free or temporary mail providers. The practical consequence is that the restriction on disposable and free-mail sign-ups can be circumvented, which matters wherever that restriction is used for abuse prevention, for example limiting bulk or throwaway account creation. The report does not describe any further exploitation beyond the bypass itself, and the impact is limited to the effectiveness of the blacklist feature.

The vendor acknowledged the issue, stating that they were very surprised to find such a simple vulnerability in the addon and that it would be addressed by the development team. The researcher received a $750 bounty for the bypass.

Fix

The report does not describe the specific change the vendor made. The correction implied by the root cause is to normalise the domain before the lookup, for example by lowercasing the extracted domain part, or to perform the membership check in a case-insensitive way, so that any casing of a blacklisted domain matches. Either approach makes the comparison consistent with how domain names actually behave.

Variants to test

  1. Case variation on other blacklists and allowlists. Submit a restricted domain with mixed or upper case, for example [redacted]. A positive result is that the address is accepted where the lowercase form is rejected.
  2. Case variation on other string-based checks. Look for any security decision based on comparing user-supplied strings against a fixed list, such as blocked file extensions, forbidden usernames or denied referrers. A positive result is that a differently cased value passes a check its canonical form fails.
  3. Trailing dot on the domain. Try [redacted] where the domain is compared as a string. A positive result is acceptance despite the domain resolving to the same provider.
  4. Unicode or homoglyph domains. Try a domain that resembles a blacklisted one but uses different characters. A positive result is acceptance of an address that a user would read as the restricted provider.
  5. Subdomain forms. Try [redacted] or similar. A positive result is acceptance where the check only matches the exact blacklisted string.
  6. Whitespace and encoding around the domain. Try leading or trailing spaces, or encoded characters in the domain part. A positive result is that the normalised domain differs from the stored blacklist entry and the check passes.

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

What happened, in plain words

A security researcher was invited to a private bug bounty program. A bug bounty program is a scheme where a company pays people to find security problems in its software and report them privately, instead of the finder using them or selling them. This particular program had been running for three years. During that time it had received a lot of reports, including serious ones such as SQL injection (where an attacker sneaks database commands into input), XSS (where an attacker gets their own code to run in another user's browser) and deserialisation bugs (where tampered data is turned back into objects in a way the program did not expect). According to the author, nobody had reported anything for over a year. He then spent three days on the target and found a very simple bug.

The bug was not in the main application. It was in a plugin, a piece of software that plugs into the main product to add a feature. The program said explicitly that bugs in its plugins counted too. The plugin was open-source, meaning its source code is published and anyone can read it. That mattered a lot here: instead of poking at the running website and guessing how it worked, the researcher could read the actual instructions the computer follows.

The feature involved is an email blacklist. Many websites refuse to let you sign up with certain email providers, usually free ones such as temporary mail services, Gmail, Yahoo and similar. The usual way to do this is to keep a list of forbidden domains and reject any sign-up where the part of the email after the @ matches an entry on that list. So [redacted] would be rejected because gmail.com is on the list.

The weakness is a logic flaw: the rules of the program can be bent without breaking anything technical. Specifically, it is an email blacklist bypass. The researcher got a $750 bounty for it.

Setup

The report describes no special accounts, roles or tools. The one thing that made the work possible was access to the plugin's source code, because it was open-source. The researcher read through it looking for mistakes in how the feature was implemented, rather than testing the feature blindly from the outside. The only thing needed to trigger the flaw is an email address sent to the sign-up or validation step that performs the blacklist check.

Finding it

While reading the source, the researcher came across a small routine that did the domain check. The code takes the user's email address, for example [redacted], pulls out the domain part, and checks whether that domain appears on the blacklist. The author is careful to point out that sending an address whose domain is simply not on the list is not a bypass at all. A bypass only exists if a domain that is supposed to be blocked gets accepted.

The mistake is in how the membership check is written. The application uses PHP's in_array function. PHP is a programming language commonly used for websites, and in_array is a built-in helper that answers the question "is this value somewhere in this list?". The catch is that it compares text exactly, including upper and lower case. So the domain comparison can be defeated just by changing the case of the domain: [redacted] becomes [redacted], and the in_array call answers "no" when asked whether the domain is blacklisted. The address is then treated as if it came from an allowed provider.

Exploitation

Step 1: Submit a blacklisted domain in its normal form

Register or validate with an address on a restricted domain, for example:

Text
[redacted]

This is a single email address, nothing more. The part before the @ is the mailbox name and the part after it is the domain, the name of the mail provider. Here the domain is gmail.com, written in lowercase exactly as it appears on the blacklist. Without that baseline you would not know whether a later acceptance meant anything.

Step 2: Change the case of the domain part

Submit the same address with the domain in a different case:

Text
[redacted]

Again this is just an email address. The mailbox name is unchanged; only the domain is now written as GMAIL.com. To a human, and to the mail system, this is the same provider as gmail.com, because domain names are not case-sensitive. But the in_array comparison is case-sensitive, so GMAIL.com does not match the lowercase gmail.com entry on the blacklist and the function answers "no". The in_array comparison does not match the lowercase blacklist entry and answers "no".

The report shows no captured requests or responses. The demonstration is the behaviour of the check as seen in the source, together with the two address forms above.

Root cause

The blacklist lookup relies on PHP's in_array, which compares text case-sensitively. Domain names, by definition, are not case-sensitive: gmail.com, GMAIL.com and Gmail.com all point to the same provider. The code normalises neither side of the comparison. It does not convert the extracted domain to lowercase before the lookup, and it does not use a comparison that ignores case. Any variation in capitalisation of a blacklisted domain therefore fails to match and passes the check.

The defence itself, the blacklist, was never broken at the data level: the restricted domain was on the list the whole time. The check simply did not recognise it when it was written differently. Because the plugin was open-source, the flaw was visible in the source, but the report gives no indication that anyone had found it by testing during the preceding three years.

Impact

The bypass defeats the check meant to block addresses from restricted domains such as free or temporary mail providers. In practice, the restriction on disposable and free-mail sign-ups can be circumvented. That matters wherever the restriction is used to prevent abuse, for example to limit bulk or throwaway account creation. The report describes no further exploitation beyond the bypass itself, and the impact is limited to how well the blacklist feature works.

The vendor acknowledged the issue, saying they were very surprised to find such a simple vulnerability in the addon and that it would be addressed by the development team. The researcher received a $750 bounty for the bypass.

Fix

The report does not describe the specific change the vendor made. The correction that follows from the root cause is to normalise the domain before the lookup, for example by converting the extracted domain part to lowercase, or to perform the membership check in a way that ignores case, so that any capitalisation of a blacklisted domain matches. Either approach makes the comparison behave the way domain names actually do.

Variants to test

  1. Case variation on other blacklists and allowlists. Submit a restricted domain with mixed or upper case, for example [redacted]. A positive result is that the address is accepted where the lowercase form is rejected.
  2. A positive result is that a differently cased value passes a check its normal form fails.
  3. Trailing dot on the domain. Try [redacted] where the domain is compared as text. A positive result is acceptance even though the domain resolves to the same provider.
  4. Unicode or homoglyph domains. Try a domain that looks like a blacklisted one but uses different characters. A positive result is acceptance of an address that a user would read as the restricted provider.
  5. Subdomain forms. Try [redacted] or similar. A positive result is acceptance where the check only matches the exact blacklisted string.
  6. Whitespace and encoding around the domain. Try leading or trailing spaces, or encoded characters in the domain part. A positive result is that the normalised domain differs from the stored blacklist entry and the check passes.

Glossary

  • Bug bounty program: a scheme where a company pays people to find and privately report security problems in its software.
  • Private program: a bug bounty program that only invited researchers can take part in.
  • Plugin / addon: a piece of software that plugs into a larger product to add a feature.
  • Open-source: software whose source code is published and can be read by anyone.
  • Source code: the instructions a programmer writes, which the computer follows.
  • SQL injection: a bug where an attacker slips database commands into input the program trusts.
  • XSS (cross-site scripting): a bug where an attacker gets their own code to run in another user's browser.
  • Deserialisation: turning stored or transmitted data back into objects inside a program; a bug here means tampered data is turned into something the program did not expect.
  • Logic flaw: a bug where the program works as written but the rules can be bent, because the reasoning behind them is wrong.
  • Email blacklist: a list of email domains that a site refuses to accept at sign-up.
  • Domain: the part of an email address after the @, or the part of a web address that names the site, such as gmail.com.
  • Blacklist bypass: getting past a block list so that something it is meant to stop is accepted anyway.
  • PHP: a programming language commonly used to build websites.
  • in_array: a PHP function that checks whether a value appears in a list, comparing text exactly, including case.
  • Case-sensitive: a comparison where upper and lower case letters count as different, so GMAIL and gmail do not match.
  • Case-insensitive: a comparison where upper and lower case are treated as the same.
  • Normalise: to convert a value into one standard form, for example making a domain all lowercase, before comparing it.
  • Bounty: the money paid for a valid security report.
  • Vendor: the company that makes and runs the software.
  • Homoglyph: a character that looks like another one but is different, often from a different alphabet.
  • Subdomain: a name placed in front of a domain, such as mail in mail.gmail.com.
  • Referrer: the address of the page a browser came from when it makes a request.

More by Sina Kheirkhah

View all

17 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.