News for hackers. Stuff that matters.
Re:We spent $20 to achieve RCE and accidentally became the a... by sebstefan on Wednesday September 11, 2024 @08:06AM (#41510544)
>The first bug that our retrospective found was CVE-2015-5243. This is a monster of a bug, in which the prolific phpWhois library simply executes data obtained from the WHOIS server via the PHP ‘eval’ function, allowing instant RCE from any malicious WHOIS server.

I don't want to live on this planet anymore

Re:We spent $20 to achieve RCE and accidentally became the a... by larsnystrom on Wednesday September 11, 2024 @08:18AM (#41510638)
The fact they're using `eval()` to execute variable assignment... They could've just used the WTF-feature in PHP with double dollar signs. $$var = $itm; would've been equivalent to their eval statement, but with less code and no RCE.
Re:We spent $20 to achieve RCE and accidentally became the a... by hypeatei on Wednesday September 11, 2024 @08:29AM (#41510710)
The fact PHP is used for any critical web infrastructure is concerning. I used PHP professionally years ago and don't think it's that awful but certainly not something I'd consider for important systems.
Re:We spent $20 to achieve RCE and accidentally became the a... by XCSme on Wednesday September 11, 2024 @09:45AM (#41511328)
Wouldn't "eval" in any language result in RCE? Isn't that the point of eval, to execute the given string command?
Re:We spent $20 to achieve RCE and accidentally became the a... by account42 on Wednesday September 11, 2024 @10:20AM (#41511642)
Fully compiled languages don't even have an eval at all.
Re:We spent $20 to achieve RCE and accidentally became the a... by sebstefan on Wednesday September 11, 2024 @10:42AM (#41511828)
Not with that attitude

Start shipping the compiler with your code for infrastructure-agnostic RCEs

Re:We spent $20 to achieve RCE and accidentally became the a... by adolph on Wednesday September 11, 2024 @12:09PM (#41512727)
When you turn pro you call it security software and add it to the kernel.
Re:We spent $20 to achieve RCE and accidentally became the a... by lambda on Wednesday September 11, 2024 @10:52AM (#41511934)
No, but they have system or the like, which is effectively the same, just being evaluated by the shell. https://man7.org/linux/man-pages/man3/system.3.html
Re:We spent $20 to achieve RCE and accidentally became the a... by mdaniel on Wednesday September 11, 2024 @12:18PM (#41512806)
And thanks to the magic of "shoving strings from the Internet into a command line", poof, RCE! It bit GitLab twice
Re:We spent $20 to achieve RCE and accidentally became the a... by xrisk on Wednesday September 11, 2024 @02:06PM (#41513798)
What incident are you referring to?
Re:We spent $20 to achieve RCE and accidentally became the a... by mdaniel on Wednesday September 11, 2024 @06:39PM (#41515913)
https://gitlab.com/gitlab-org/gitlab/-/issues/327121 is the first one, and I'm having trouble locating up the second (possibly due to the search pollution from the first one) but there are a bunch of "Exiftool has been updated to version [0-9.]+ in order to mitigate security issues" style lines in their security releases feed so it's possible they were bitten by upstream Exiftool CVEs

Anyway, turns out that shelling out to an external binary fed with bytes from the Internet is good fun

Re:We spent $20 to achieve RCE and accidentally became the a... by account42 on Thursday September 12, 2024 @04:05AM (#41518592)
a) system doesn't let you modify the state of the running process so it doesn't attract abuse like the example here. It's still a bad function but calling it effectively the same is absurd - the scope for "clever" usage of it is much much lower.

b) It's a legacy misfeature that I hope new compiled languages don't copy. There are much much better better interfaces for running processes that don't rely on an intermediate shell.

c) Shell escaping is much more stable than some hipster language like PHP where you'd need to update your escaping for new language changes all the time.

Re:We spent $20 to achieve RCE and accidentally became the a... by cryptonector on Wednesday September 11, 2024 @01:54PM (#41513709)
You can build an eval for a compiled language, absolutely. You can embed an interpreter, for example, or build one using closures. There's entire books on this, like LiSP in Small Pieces.
Re:We spent $20 to achieve RCE and accidentally became the a... by dpcx on Wednesday September 11, 2024 @08:36AM (#41510763)
I'm curious about some specifics of why you wouldn't use PHP for _critical_ web infrastructure?
Re:We spent $20 to achieve RCE and accidentally became the a... by sebstefan on Wednesday September 11, 2024 @08:45AM (#41510814)
https://duckduckgo.com/?q=hash+site:reddit.com/r/lolphp

https://duckduckgo.com/?q=crypt+site:reddit.com/r/lolphp

>crc32($str) and hash("crc32",$str) use different algorithms ..

>Password_verify() always returns true with some hash

>md5('240610708') == md5('QNKCDZO')

>crypt() on failure: return <13 characters of garbage

> strcmp() will return 0 on error, can be used to bypass authentication

> crc32 produces a negative signed int on 32bit machines but positive on 64bit mahines

>5.3.7 Fails unit test, released anyway

The takeaway from these titles is not the problems themselves but the pattern of failure and the issue of trusting the tool itself. Other than that if you've used php enough yourself you will absolutely find frustration in the standard library

If you're looking for something more exhaustive there's the certified hood classic "PHP: A fractal of bad design" article as well that goes through ~~300+~~ 269 problems the language had and/or still has.

https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

Though most of it has been fixed since 2012, there's only so much you can do before the good programmers in your community (and job market) just leave the language. What's left is what's left.

Re:We spent $20 to achieve RCE and accidentally became the a... by rty32 on Wednesday September 11, 2024 @09:47AM (#41511340)
People keep saying "oh it's php 5.3 and before that are bad, things are much better now", but ...
Re:We spent $20 to achieve RCE and accidentally became the a... by KMnO4 on Wednesday September 11, 2024 @08:44AM (#41510810)
Any language can be insecure. There’s nothing inherently bad about PHP, other than it’s the lowest-hanging fruit of CGI languages and has some less-than-ideal design decisions.
Re:We spent $20 to achieve RCE and accidentally became the a... by sebstefan on Wednesday September 11, 2024 @09:29AM (#41511171)
Don't just swipe the "less-than-ideal design decisions" under the rug
Re:We spent $20 to achieve RCE and accidentally became the a... by bell-cot on Wednesday September 11, 2024 @08:39AM (#41510778)
Modern PHP is about as solid as comparable languages. It's two biggest problems are:

Lingering bad reputation, from the bad old days

Minimal barrier to entry - which both makes it a go-to for people who should not be writing production code in any language, and encourages many higher-skill folks to look down on it

Re:We spent $20 to achieve RCE and accidentally became the a... by krageon on Wednesday September 11, 2024 @09:30AM (#41511179)
It's very easy to make PHP safe, certainly now that we've passed the 7 mark and we have internal ASTs. Even when using eval, it's beyond trivial to not make gross mistakes.
Re:We spent $20 to achieve RCE and accidentally became the a... by detourdog on Wednesday September 11, 2024 @08:13AM (#41510590)
Always look on the bright side of Life.

The non-sensicalness of it is just a phase. Remember the Tower of Babel didn't stop humanity.

Here is a link that was posted a few days ago regarding how great things are compared to 200 years ago. Ice cream has only become a common experience in the last 200 years..

https://ourworldindata.org/a-history-of-global-living-condit...

Re:We spent $20 to achieve RCE and accidentally became the a... by Noumenon72 on Wednesday September 11, 2024 @06:56PM (#41516000)
Someone may have posted a link to it a few days ago, but the link is from 2016 with a partial update last February.
Re:We spent $20 to achieve RCE and accidentally became the a... by brynb on Wednesday September 11, 2024 @08:15AM (#41510613)
that seems like a bigger lift than just deciding to help fix the bug

“be the change” or some such

Re:We spent $20 to achieve RCE and accidentally became the a... by coldpie on Wednesday September 11, 2024 @09:34AM (#41511220)
As has been demonstrated many, many (many, many (many many many many many...)) times: there is no such thing as computer security. If you have data on a computer that is connected to the Internet, you should consider that data semi-public. If you put data on someone else's computer, you should consider that data fully public.

Our computer security analogies are modeled around securing a home from burglars, but the actual threat model is the ocean surging 30 feet onto our beachfront community. The ocean will find the holes, no matter how small. We are not prepared for this.

Re:We spent $20 to achieve RCE and accidentally became the a... by GTP on Wednesday September 11, 2024 @12:08PM (#41512708)
> Our computer security analogies are modeled around securing a home from burglars

Well, no home is burglar-proof either. Just like with computer security, we define , often just implicitly, a threat model and then we decide which kind of security measures we use to protect our homes. But a determined burglar could still find a way in. And here we get to a classic security consideration: if the effort required to break your security is greater than the benefit obtained from doing so, you're adequately protected from most threats.

Re:We spent $20 to achieve RCE and accidentally became the a... by coldpie on Wednesday September 11, 2024 @01:03PM (#41513266)
I agree, my point is we need to be using the correct threat model when thinking about those risks. You might feel comfortable storing your unreplaceable valuables in a house that is reasonably secure against burglars, even if it's not perfectly secure. But you'd feel otherwise about an oceanfront property regularly facing 30 foot storm surges. I'm saying the latter is the correct frame of mind to be in when thinking about whether to put data onto an Internet-connected computer.

It's no huge loss if the sea takes all the cat photos off my phone. But if you're a hospital or civil services admin hooking up your operation to the Internet, you gotta be prepared for it all to go out to sea one day, because it will. Is that worth the gains?

Re:We spent $20 to achieve RCE and accidentally became the a... by myself248 on Wednesday September 11, 2024 @02:19PM (#41513933)
And I think there's some cognitive problem that prevents people from understanding that "the effort required to break your security" has been rapidly trending towards zero. This makes the equation effectively useless.

(Possibly even negative, when people go out and deliberately install apps that, by backdoor or by design, hoover up their data, etc. And when the mainstream OSes are disincentivized to prevent this because it's their business model too.)

There was a time, not very long ago, when I could just tcpdump my cable-modem interface and know what every single packet was. The occasional scan or probe stuck out like a sore thumb. Today I'd be drinking from such a firehose of scans I don't even have words for it. It's not even beachfront property, we live in a damn submarine.

Re:We spent $20 to achieve RCE and accidentally became the a... by ffsm8 on Wednesday September 11, 2024 @10:03AM (#41511502)
by this logic, every picture you'll ever take with your phone would be considered semi-public as phones are Internet connected.

While I wouldn't have too much of an issue with that, I'm pretty sure I'm a minority with that

Re:We spent $20 to achieve RCE and accidentally became the a... by coldpie on Wednesday September 11, 2024 @10:09AM (#41511556)
Re:We spent $20 to achieve RCE and accidentally became the a... by ruthmarx on Wednesday September 11, 2024 @12:37PM (#41512986)
> As has been demonstrated many, many (many, many (many many many many many...)) times: there is no such thing as computer security.

Of course there is, and things are only getting more secure. Just because a lot of insecurity exists doesn't mean computer security isn't possible.

Re:We spent $20 to achieve RCE and accidentally became the a... by coldpie on Wednesday September 11, 2024 @01:05PM (#41513286)
It's a matter of opinion, but no, I disagree. People are building new software all the time. It all has bugs. It will always have bugs. The only way to build secure software is to increase its cost by a factor of 100 or more (think medical and aviation software). No one is going to accept that.

Computer security is impossible at the prices we can afford. That doesn't mean we can't use computers, but it does mean we need to assess the threats appropriately. I don't think most people do.

Re:We spent $20 to achieve RCE and accidentally became the a... by ruthmarx on Wednesday September 11, 2024 @03:25PM (#41514538)
It's not a matter of opinion at all. You can disagree but you can disagree with the earth being a sphere also.

> People are building new software all the time. It all has bugs. It will always have bugs.

No. Most bugs these days are due to legacy decisions where security was not an issue. We are making advances in both chip and software security. Things are already vastly more secure than they were 20 years ago.

20 years from now, security will be a lot closer to being a solved problem.

> The only way to build secure software is to increase its cost by a factor of 100 or more (think medical and aviation software). No one is going to accept that.

What are you basing that cost on?

> Computer security is impossible at the prices we can afford.

No, it really isn't. There's a reason some organizations have never been hacked and likely never will be. Largely because they have competent people implementing security that very much exists.

Re:We spent $20 to achieve RCE and accidentally became the a... by callalex on Wednesday September 11, 2024 @02:17PM (#41513916)
Do you use a bank account? Or do you still trade using only the shells you can carry in your arms? Perhaps networked computers are secure enough to be useful after all.
Re:We spent $20 to achieve RCE and accidentally became the a... by coldpie on Wednesday September 11, 2024 @03:09PM (#41514394)
I never claimed the Internet isn't useful. I just think people don't recognize how vulnerable computers are to attack. Search this very incomplete list for "bank": https://en.wikipedia.org/wiki/List_of_data_breaches
Re:We spent $20 to achieve RCE and accidentally became the a... by JW_00000 on Wednesday September 11, 2024 @12:45PM (#41513067)
Have you ever witnessed a house being built? Everywhere is the same :) At least in our industry these issues are generally not life-threatening.