Skip to content
Access control Write-up Beginner

Weak Regex, Big Mess: How I Escaped Input Validation with One Tin

The login form used a weak client-side regex for email validation, and the server did not validate emails properly, allowing an attacker to log in with malformed emails like 'test@internal-admin.' and gain access to internal accounts. This led to access to an internal dashboard with sensitive data.

iski Follow

Published on infosecwriteups.com

Free Link 🎈

Iski, on infosecwriteups.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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the server relied on client-side email validation and did not properly validate the email format on the backend, allowing malformed emails to be accepted.

Impact

The attacker could bypass authentication, enumerate internal accounts, access sensitive data including user sessions and payment logs, and escalate privileges to admin functionality.

What the attacker needed

Access to the staging login portal; guessable or reused passwords

The fix

The server should validate email addresses on the backend using strict rules, not rely on client-side regex.

How it was found

  1. Found a staging login portal and noticed client-side JavaScript validation.
  2. Inspected the regex used for email validation and identified its weaknesses.
  3. Sent a POST request with a malformed email like 'test@internal-admin' and a password.
  4. Received a 200 OK response with 'Welcome, internal-admin!' indicating successful login.
  5. Wrote a script to enumerate internal email formats and found multiple valid accounts.
  6. Accessed the internal dashboard at /internal/dashboard with the compromised credentials.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The website checked email addresses only in the browser, not on the server. A hacker could bypass this check by sending a specially crafted email address directly to the server, which then accepted it and logged them in as an internal user.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by iski

View all

186 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.