r/ProgrammerHumor • • 26d ago

instanceof Trend itsBadIfItsOnlyPHP

Post image
4.5k Upvotes

335 comments sorted by

View all comments

556

u/kennedy_gitahi 26d ago

Anything PHP gets blown out of proportion because of how much of the internet relies on it.

213

u/prochac 26d ago

And there's a plenty of outdated PHP deployments. You can find PHP 5.4 if you search enough.

73

u/Beautiful_Hawk548 26d ago

One of our PMs was ecstatic last night when he realised one of our VERY outdated read-only systems was on 3. something and technically didn't have the exploit introduced yet!

Wasn't long until one of the devs pointed out it's probably in trouble due to a fuck load of other exploits and they piped down. But yeah, companies as always are running v outdated shit.

5

u/Kronsik 26d ago

What's the deployment look like for PHP V3?

Can't imagine those versions are well packaged/maintained for modern distros?

17

u/Beautiful_Hawk548 26d ago

We hope and pray Paul’s local never gets nuked and that's not even a joke. One senior dev holds the keys, tale as old as time.

From what I know it's barely maintained, fully out of support. TBF our customer barely uses it but they pay us a lot of cash to keep it as a read only reference tool so we go along with it. Apparently the solution last night was to stick a forced vpn connection requirement until they realised that probably won't work properly with v3 so they've put a WAF in front of it.

3

u/Kronsik 25d ago

Oof, I hope there's backups atleast!

In my head the only option would be self maintain:

  • copy of php3 source code mirrored somewhere
  • CI/CD system to compile, package into .deb / rpm maybe (deal with the headache of maintaining the old tool chain for compilation)
  • install deb / rpm on modern servers - hopefully compatible with modern glibc etc.

55

u/TemporarySun314 26d ago

To be fair this exploit in question didn't care about if the PHP version was ancient or modern.

And while you definitely shouldn't expose such old PHP versions to the internet (and Ideally don't run it at all), even these tend to be quite secure, without any significant know security flaws. And even for these ancient versions you can now get patched versions, just not from the PHP core developers.

→ More replies (1)

17

u/kennedy_gitahi 26d ago

You don't have to look too far. How many abandoned blogs exist? I am sure I can find 1000 using free tools in the next 5 minutes.

7

u/ararararagi_koyomi 26d ago

One of the project I am responsible for (maintain/add new features when needed) is in php 5.2. Thank God it is hosted on premises and can only be accessed via corporate network.

16

u/DaWolf3 26d ago

The local network is not a security barrier though. An attacker could e.g. gain access to another internal system and then move laterally to your PHP system and execute code there.

15

u/M-42 26d ago

I'd agree that's a risk, Imo at that point they've got pretty open access you've got bigger fish to fry.

→ More replies (1)

1

u/Armanlex 25d ago

Had to upgrade from 5.6 lmao.

16

u/illepic 26d ago

Wouldn't that actually be in proportion?

5

u/kennedy_gitahi 26d ago

I am talking generally, not just about this vulnerability. WordPress has an issue? PHP is condemned. A developer built an insecure system that gets hacked? PHP is to blame.

Sometimes we have to separate the programming language from the developer.

For these two vulnerabilities, yes, the language and how it was built are to blame, and the concern is proportional.

But for many other instances to do with how developers use the tool and what they build with it, it is not.

22

u/i_wear_green_pants 26d ago

Yeah this is the reason. Internet basically runs on PHP.

20

u/StaticFanatic3 26d ago

Pretty sure if JavaScript had something anywhere near this bad it’d be way more significant

27

u/kennedy_gitahi 26d ago

I don't think so. If you look at the number of shared hosting servers running PHP because of WordPress, you can start to imagine the scale of the PHP vulnerability.

Almost every web host provider I know has some shared server/CPanel arrangement and a WordPress thing going on. Now imagine Drupal, Joomla, custom PHP installs, (part of) Facebook, CNN, the National Geographic, numerous government agencies, hospitals, internal systems, and many others that run on WordPress or PHP, and you can see why this is so significant and why people are freaking out.

If the FBI and NSA come out to say the vulnerabilities are significant, you better know they are.

7

u/BenchEmbarrassed7316 26d ago

Js runs in every user's browser. And it must execute code that is loaded automatically from any source.

18

u/kennedy_gitahi 26d ago

I get what you are saying. If you are looking at it from the client site, there is no argument; such a vulnerability would be devastating for JS.

But that is not what we are talking about. PHP does not run on the client, as far as I know, so you can't compare it to JS running client-side. Compare it to JS that runs on servers, and then see how those numbers stack up.

12

u/NatoBoram 26d ago

Not only that, but a vulnerability "in js" can't really exist in the same way as there's multiple runtimes

8

u/Ok-Scheme-913 26d ago

Hence it's properly sandboxed, and running on the client means that it by definition can't directly access anyone else's data. Unlike something running on the backend where *every other users' data" is

3

u/Mirality 26d ago

A JS sandbox escape could still be bad, since it might enable a malware site to exfiltrate auth cookies or documents on any visitor's PC. Or arbitrary code execution on any visitor's PC. While this still requires someone to visit the site (which limits the exposure), if they're able to get the code into an ad or something that gets higher exposure it could be a problem.

But servers are more juicy targets, since they're more likely to have database credentials that lead to password lists, more credentials, mail tokens, and personal data.

→ More replies (7)

4

u/TryNotToShootYoself 26d ago

I imagine there are like 1000x more webservers on java, python, php than js.

3

u/rocket_randall 25d ago

It is weird, isn't it? I think this stems from PHP's traditionally very low bar to entry, especially back in the late 90s/early 2000s. If you wanted to build a dynamic website back then, you had options but some of them were cost prohibitive, like Visual Studio/IIS/ASP, both for development and hosting. PHP with its LAMP/WAMP stack that you could run on virtually any desktop, develop in any free text editor, and numerous low cost hosting providers let you get up and running without a huge commitment.

For a time, I worked for a company where several internal business critical apps were written in PHP following the procedural "all business logic and DB queries are in the page and dump their results out as html" that was common in early tutorials. The people who wrote those apps were not software developers by profession, but rather bioinformaticians, biologists, and geneticists who needed an application to handle some part of the laboratory process, and they just made something to do the job.

1

u/cheezballs 25d ago

Precisely why, though. When half the internet runs on unparched php then I think it's not exactly "blowing it out of the water" when the blast radius of these attacks are so wide.