114 points · by CiPHPerCoder · 9y ago · 30 comments
That doesn't ring true to me. Personally, I think a lot of the perception is just that PHP appeals to a broad audience, so there's a lot of unskilled people producing code.
There are some language inconsistencies so "messy" might be justified. I don't see it, though, as inherently less secure than other popular languages.
If you mean, for example, SQL injection, php does provide the correct path, and it's in their documentation. Sure, it's possible to use aribtrary strings in SQL, but it's also possible in Python, Ruby, Perl, and so forth. Similar for traps like eval().
These sort of things aren't obvious and can very easily (and justifiably) be blamed on the language itself.
A lot of PHP crypto libraries are very cavalier about using functions without understanding their implementation details.
https://github.com/devi/Salt/blob/fde775cf52402013efce812759...
https://github.com/phpseclib/phpseclib/blob/ab1da5ac1f2fa60b...
https://github.com/zendframework/zend-crypt/blob/9b7da4a6d4d...
Fortunately, most cryptography libraries these days just wrap OpenSSL and rarely implement their own ciphers or hash functions.
Thankfully the PHP community now has a group like Paragonie willing to share implementation risks. And because of that, we can help solve the problem with pull requests to those libraries.
It's not just that. There's also a lot of people who spent their entire careers working in the PHP ecosystem. All the bad practices common among beginners get ingrained in them as their go-to design patterns, because they never learn things like "authenticating APIs with cookies is bad", or "business logic doesn't belong in the controller". They'll even defend their bad patterns because "that's how we've always done it", never making the connection between what they've always done and the problems they've always had.
All the more reason for the language to be opinionated and force developers do things securely. The path of least resistance should be to write good code; let developers abuse the language if they really want to, but make them have to work hard to do that.
PHP is extremely easy to set up and use. Ruby is a quagmire of dependencies and build environments.
This makes php bashing on HN tedious and disconnected from reality. There is a clear preference here for tech that pays more and but let's not try to pass it off as a technical preference.
There isn't such an analysis yet, but I intend to do one in the near future. We have a similar analysis for out-of-box security features of popular open source CMS: https://paragonie.com/blog/2016/08/on-insecurity-popular-ope...
Our security page has some of the audits we've done (at least, the ones we were permitted to publish) as well as our security advisories. https://paragonie.com/security
I'm pretty active in the PHP community and get looped into a lot of pull request discussions (e.g. https://github.com/facebook/php-graph-sdk/pull/552#issuecomm... for Facebook's SDK), but it's possible I've missed a few.
SMF 2.1 for instance is purely development releases that are _not_ supposed to be used in production.
http://www.simplemachines.org/community/index.php?topic=5354...
> As always, keep in mind that Beta Releases are NOT recommended for production sites.
It is just the first time I've ever seen someone create a CVE for what is essentially a do-not-run-this-in-production code branch for an open source project. I'm used to people waiting until at least a Release Candidate version before doing that.
Do you have any other instances you'd like to inquire about?