Skip to content
RCE Write-up Intermediate

Cracking the Code: How I Found a Zero-Day in Criminal Chatter and Cashed In

A WAF was bypassed by sending JSON with a text/plain Content-Type, allowing NoSQL injection and JWT secret leakage, which led to full privilege escalation and access to sensitive internal data.

infosecwriteups.com

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 WAF trusted the Content-Type header to decide whether to apply JSON inspection rules, and the backend still parsed text/plain bodies as JSON, while the application also leaked its JWT signing secret in error messages.

Impact

An attacker could bypass the WAF, extract all user data, forge admin tokens, and access database credentials, AWS keys, encryption keys, and source code repository tokens.

What the attacker needed

Access to dark web forum; knowledge of target domain; ability to send HTTP requests

The fix

The WAF bug was fixed according to the text, but the report does not describe the fix; it should be fixed by not relying on Content-Type for security decisions and by removing secrets from error messages.

How it was found

  1. Fingerprint the WAF to identify CloudGuard.
  2. Mine certificate transparency logs to find a testing subdomain.
  3. Send a JSON body with Content-Type: text/plain to bypass the WAF.
  4. Use NoSQL injection operators to retrieve all user records.
  5. Trigger an error that leaks the JWT secret.
  6. Forge an admin JWT and access internal configuration endpoints.

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.

A web application firewall (WAF) is a security filter that inspects incoming requests. The WAF only checked requests labelled as JSON, so the attacker sent the same data labelled as plain text to sneak past it. This let them run database queries that returned all user records and later forge admin login tokens.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.