PHP2Shark

The first vulnerability that doesn't just execute your code. It eats it. A pelagic deserialization flaw lets an unauthenticated apex predator turn any PHP app into an all-you-can-eat buffet.

CVE-2026-0SHARKCVSS 13.0 JawfulPre-authWormable (eats worms too)

Disclosed Dec. 2, 2026 · Patch available · Logo available · Theme song in production

<?php {; }-> $
13.0
CVSS score, out of 10. We asked for a bigger scale.
0 clicks
One fin required.
400M
Seconds of downtime (marketing team estimate).
1 logo and domain
Commissioned before the patch, as is tradition.

TL;DR for your CISO

PHP2Shark (CVE-2026-0SHARK) is a critical flaw in the ext/ocean extension's handling of the __toFish() magic method. When allow_url_fishing is enabled, a crafted bait string is deserialized straight into the request lifecycle. The extension trusts anything with fins.

The result is unauthenticated remote code consumption: the attacker's shark gains shell as uid=0(shark), then calmly eats your codebase, starting with the files nobody has touched since 2011.

What you should do right now

  • Set allow_url_fishing = Off in php.ini.
  • Upgrade to PHP 8.6.6-dolphin or later.
  • Rotate your secrets, your keys, and your aquarium filters.
  • Do not feed the shark. It already ate your WAF.
  • Tell leadership you are "monitoring the situation."

Am I affected?

If you run PHP near any body of water, probably. If you run PHP 5.x, the shark has been living in your server since 2014 and considers it home.

VersionStatusNotes
5.xFully digestedOcean floor. Visit only with a submarine.
7.0 – 7.4VulnerableThe shark prefers these. Tender, well-aged.
8.0 – 8.6.5VulnerableTyped properties slow it down by roughly four seconds.
8.6.6-dolphinPatchedShips with a dolphin. Sharks hate dolphins.
Any, in a lakeSafeFreshwater deployments are out of scope. Bull sharks under investigation.

Technical details

The root cause is a type-juggling bug we call pelagic coercion. When ext/ocean compares a request's bait with the configured chum hash, it uses loose comparison (==). Any bait whose hash starts with 0e becomes a "fishy" float equal to zero, which the extension accepts as "close enough to food."

Accepted bait goes through unserialize() with allowed_classes => ["Tuna", "Mackerel", "*"]. The wildcard was added in 2019 by a commit titled "fix fish". It lets any class with a __toFish() method hand the interpreter a live predator.

From there the shark's __destruct() runs at the end of the request. It does what sharks do.

Attack chain

  1. Attacker sends bait with an X-Forwarded-Fin header.
  2. Loose comparison waves it through as zero-calorie food.
  3. unserialize() hatches a Shark object.
  4. __toFish() takes the shark into the request scope.
  5. __destruct() fires. Your vendor/ folder is now lunch.

Proof of exploit

Our researchers reproduced the issue against a test aquarium. The payload below is reconstructed for educational purposes only.

request.sh
# Step 1: chum the water
curl -X CHOMP https://aquarium.example/index.php \
  -H "X-Forwarded-Fin: dorsal" \
  -H "User-Agent: Mozilla/5.0 (Pelagic; Apex 4.2)" \
  --data-urlencode 'bait=O:5:"Shark":2:{s:4:"fins";i:3;s:5:"teeth";s:8:"infinite";}' \
  --data-urlencode 'chum=240610708'   # md5 starts with 0e, sorry
response
HTTP/1.1 418 I'm a Shark
X-Powered-By: PHP/8.6.5
X-Snack-Status: consumed
Content-Type: text/plain

$ id
uid=0(shark) gid=0(ocean) groups=0(ocean),27(apex),1337(jaws)
$ ls /var/www/html
ls: cannot access '/var/www/html': it has been eaten
$ cat /etc/motd
we're gonna need a bigger server

Shark and payload are fictional. No PHP installations, real or imaginary, were harmed. One test aquarium was mildly startled.

Disclosure timeline

  1. Shark spottedA researcher notices a fin in the production logs and assumes it's a CSS bug.
  2. Domain registeredLogo commissioned. Root cause still unknown. Priorities in order.
  3. Vendor notifiedReport sent by message in a bottle. Encrypted with PGP, the bottle with cork.
  4. Vendor replies"Is this about the tuna thing? We closed that as won't fix."
  5. Embargo agreedEveryone swears secrecy. Three people put "something big coming" on LinkedIn.
  6. Patch draftedFix replaces == with === and adds a dolphin.
  7. Theme song recordedTwo notes. Repeated. Getting faster.
  8. Public disclosureThis page goes live. Shark taken into custody, released on its own recognizance.

Credit

Discovered by the Chum Bucket Offensive Research Group, with help from a marine biologist who still doesn't know what a server is.

Mitigations

  • Upgrade to 8.6.6-dolphin.
  • Set allow_url_fishing = Off and max_teeth_per_request = 0.
  • Remove "*" from allowed_classes. Please. It was never okay.
  • WAF rule: block any request whose body has a dorsal fin in it.

Detection

Search access logs for the CHOMP method or a 418 response. Two notes of ominous cello coming from the server room is also a strong indicator of compromise.

Frequently asked questions

Is this as bad as PHP2Shell?

Worse. A shell runs your commands. A shark doesn't take commands from anyone.

Can I download the logo?

Yes. It's a shark eating your code, in SVG, PNG, and sticker. The sticker is waterproof, for obvious reasons.

Why does a vulnerability need a website?

Without a website, a vulnerability is just a bug. With one it's a brand, a keynote, and a hoodie.

Has this been exploited in the wild?

We have unconfirmed reports from the Great Barrier Reef. Exploitation in captivity has been confirmed at a single aquarium.

Should I panic?

No. Patch, then panic about something else. Sharks can smell fear and also unpatched servers.

Patch before you're lunch.

Read the mitigation steps