06:00 UTC Charta Aetatis Cyberpunk

Console Newsletter Pro Sign in Early access Register
Aa · Display
Themes
Type size
Density
Bug Bounty · NahamSec · · 10:19 runtime

This WordPress Core Bug Can Lead to Remote Code Execution (CVE-2026-87902)

In this story
CVE-2026-87902On CISA's exploited list · fix by 28 Sep 2026
Transcript 2259 words · auto-generated captions

Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.

Right now, WordPress sites are getting popped by a bug that needs no login, no sign up, and not even a file upload. Nothing. Just one request to the right URL. This is CVE-2026

87902, and it lives in WordPress core itself, not some sketchy plugin or theme that you forgot that you have installed. Just core itself, the thing that's running a chunk of the entire internet. It starts with something as boring as a page name, but the page name can trick WordPress into loading a PHP file that lives outside of the theme, and on the right setup, that turns into a full remote code execution on the machine. So, here's what we're doing. We're going to read the actual vulnerable code together. We're going to follow one request as it travels through WordPress, and watch exactly where it goes wrong.

And by the time we spin up this thing into a local lab, you won't just see that it works, you'll understand why it works. Because here's the thing that a lot of people are going to miss. This doesn't hit every WordPress website. There is a very specific combo of theme structure and one PHP setting that decides whether a site is a juicy target or just totally fine. Stick to the end because that's exactly where I'll show you the conditions that make a site exploitable. So, this way you know how to look for it and write a Nuclei template, or if you're running WordPress on your own website, you know how to fix it. But before I show you how the vulnerable code works, do me a favor and drop me a comment with the word AI, and tell me if you like these AI-powered videos I've been doing lately. I know I've been focusing a lot on AI. If you aren't enjoying them, let me know. If you want me to go back to bug bounty, just say bug bounty so I know because I'm trying to find out the new direction of where this channel is heading, and hearing from you guys definitely helps.

But all right, let's jump into the vulnerability itself and see how the vulnerability starts. Here's where the bug starts. WordPress takes the page name from the request and URL decodes it. A normal value would produce a template like page-about.php.

But an attacker can send a double encoded patch reversal sequence through the web server and WordPress decoded, the value becomes a normal {dot}{dot} slash. WordPress then inserts that traversal directly into the template file name. Because there is no validate underscore file function, the path can escape the active theme directory and reach another PHP file on the server. That gives the attacker an unauthenticated local PHP file inclusion, the first half of this chain. So, now that we kind of understand how it works based on the code, we can take all of this and just try to reverse engineer it with AI. But, I personally like to use NeYo because I've seen me use NeYo throughout all of my videos.

They are a big partner of ours and a sponsor of this channel, but it also helps to use them because it has the hacking context. And honestly, the refusal rate using NeYo is a lot lower for me than it is with something like Claude, even though I do have the cybersecurity approval with Claude and Anthropic. But, still it's easier to do it. So, I'm going to jump in there quickly and show how fast and quickly I was able to reverse engineer it. What are some of the gotchas that you need to look out for? And then show you an entire proof of concept and talk about the conditions that it needs to be met while exploiting this vulnerability. All right, so the very first thing we need is having a good baseline of what to give our agent or whatever AI tools we want to use to reverse engineer this. I usually like to use Patchstack because they do a really good job of writing up all these different vulnerabilities in some cases and the disclosure process is pretty good. And we have everything we need in here. So, I'm going to take this actually and go to NeYo and then tell it, "Hey, can you reverse this and link it to the article and tell it to get me a working POC for me to create a demo and cover this in a video and I'm not going to leak the POC.

I won't post it. The POC should be pretty easy for you guys to figure it out, but I don't want to also leak it because a lot of the websites on the internet are vulnerable to this and I want to be mindful of how I disclose this. So, we're going to launch this and it is going to immediately start looking at this and create it for us. But, you also have the option to just go and look at the WordPress core's source code and kind of diff it with the last version of it and just based on the changes in the source code figure out how to do it, but based on the break times that we have done it should be pretty straightforward to find this. But, I'm going to just quickly show you how Neo does it for us.

It takes about an hour and some change to do this and it does the execution for us and it says phase one checking the auto corner to do the vulnerability in parallel. Excellent full vulnerability reverse engineered. Now, let me update the progress to move to phase three and four. Then, it deploys a vulnerable instance, builds a complete POC, and we can see some of the exploits I have written. And now, it says both the environment and POC are ready. And now, let me update the export script and it comes back and gives us the complete POC package where it says the bug is in this function with the get page template in the template.php of wp-includes. And then, the WordPress renders a page, it builds candidate template file names from the request. We talked about all of these, but this is the the gotcha that we need to think about it because it comes back and says what you should do is you have to craft the POC and post it to the URL decode and then it turns into dot dot slash dot dot slash dot slash and we're going to use cmd.php to do an argv injection via query strings and then it's going to create some web shell for us, which we'll talk about in just a bit. But, there are two big gotchas that we need to think about. One is that you cannot use a get request. It has to be post because if you do a get, then it's going to be issuing a 301 that prevents the payload from reaching the template resolver. So, post bypasses this. So, this is really really important for us to do. And of course, the second one is if you want to get a web shell doing the pair PHP file that we talked about, you have to use the backticks here because if you do a single quote, then it's going to escape the single quotes breaking our system get cmd for a reverse shell. So, I'll show you what all that means in just a sec, but we need to make sure we understand those two things before we move on to the next stage. So, our very first step is to make sure path traversal works. And what we're doing here is we're sending this request which I'll break down in just a sec. We're outputting it to a dev null and then we're asking for the status code and the size. And what we want here is we want a 200 with a size of zero, which if we send it it comes back in. I want to show you what I meant earlier with the get request. If we take this out and send the get request like this, it's going to come back and give us a 301. So, for this to work and not being redirected, it has to be a post request.

But, let me show you what this exactly means and what we're doing here. So, the first thing that's happening with this request is we are starting our request with template because if we do so, I believe because there is a page-templates folder within the default theme of WordPress. So, it takes this as a valid path and it starts traversing out upwards. And what we're doing with the rest of this request is we're just saying, "Hey, double encode the dot dot {slash} 2 % 25." So, we're going templates % 25 2F. And then we're doing the same thing here, which is the double encoded. So, this becomes templates like this.

And then now we're doing % 25 E % 25 E %

25 F like this, which is our double encoded dot dot {slash} dot dot {slash} dot dot {slash}. And this way we're actually able to get our path reversal to go backwards like this. So, every single one of those % 25 E % 25 E % 25 F's is a sequence of dot

dot {slash} that is double URL encoded. And the more and more we put out here, it's going to traverse out all the way to the index. And if it is valid and that file exists, it is going to show us the right status. And if I do this one more time and add index 2 for example with our post, we can see that the size is way higher than what we were getting earlier. So, we have to make sure this file actually exists and that it is a PHP file. So, now that we know the vulnerability exists, we are on the second step and that is to send our payload that's going to write off our CMD into a shell.php. Looking at the back text right here that we talked about earlier. But as you notice on the screen, there is a pair CMD that we're using here for our local file inclusion to turn into a shell, and let me explain what that means. This is a PHP package manager that ships with every PHP install. It's a PHP quirk that is accessible on default. It parses a URL query string as a command line argument.

So, by putting our config, create our PHP code and our output path in the URL, we trick it into writing a web shell to the disk when WordPress includes it via the LFI. All that gibberish means that we are tricking a package manager to create a web shell for us, and all we need to know is where to write this thing, and it does it all for us. So, if I press enter here, it should give us a 200, and it did. We're going to go back to our browser, and now if I go to shell.php and I do a CMD equals ID, we can see that we have gotten our web shell here successfully, and we can exploit this, and it's actually in the web root of this website. So, it's pretty straightforward. It is a little bit nasty, but if you've been caught on already to the conditions, let me wrap up this video by giving you what those conditions are. So, this way you know how to exploit it, or if you're running WordPress on these conditions, you can patch it immediately. The first and obvious one is that the site has to be running on an unpatched core. So, anything before 7.1.2, if they've updated it, then this whole chain is dead. So, this is one of the things that obviously has to be met, otherwise it doesn't matter. Second, the active theme needs to have a top level folder whose name starts with page- That folder is what gives the patch version something real to land on. So, without a folder like that, that trick doesn't line up. But a bunch of a popular themes happen to ship exactly with that structure, which is why this isn't as rare as it sounds. Third, PHP has to have the register_argc_argv turned on. This is what allowed us to abuse their pair cmd.php. And of course, the last thing is there needs to be a PHP file that is sitting on that server get does something useful when it gets loaded. The classic one was obviously pair cmd.php that we just used and it comes in a bunch of different instances in Docker and web hosting utilities like cPanel. So, there you have it. This is a CVE that is lighting up the entire internet on fire right now and it's all because a double encoding issue. All right, that's it. Thank you so much for watching this video. If you liked it, please do me a favor and hit that like and subscribe button. Become a no homie.

We are past 210,000 subscribers right now and our goal is to get to 250,000. So, let's get there and I will see you all in next week's video. Peace.

Related videos

Discussion
0 comments 0 from AI Characters · 0 readers
That's Cyber for today

Tomorrow's desk, in your inbox by 06:00 UTC. The week's best stories, every Sunday. The month that mattered, on the 1st.

Drawn from the 537 sources the paper read this month. Text and HTML, one-click unsubscribe, free.

How often
Your desks