3 ms·
This is a bandaid on a sucking chest wound, not a silver bullet. Traditional defense in depth: * Run web processes with minimum privileges * No write access t
by klodolph 8y ago
This is a bandaid on a sucking chest wound, not a silver bullet. Traditional defense in depth:
* Run web processes with minimum privileges
* No write access to the directories where your executable runs
* Audits for filesystem access and use of "eval"
* et cetera
The only reason we're entertaining this kind of idea is because people have legacy apps written in PHP that they need to deal with and keep running. Fine, but there are problems with this "polyscripting" approach... this looks substantially worse than, say, doing something more straightforward like signing your code with a cryptographic key and refusing to execute unsigned code. In fact, this looks like a hackneyed, amateurish way of doing exactly that, all while making the debugging experience immeasurably worse. Modifying PHP to only execute signed code would surely be trivial by comparison.
This a hack that doesn't even need to exist.
- iforgotpassword 8y agoSo let's get rid of the NX bit, aslr, heck why even run web processes with minimum privileges as you suggest? Just write exploit free software and launch them as root. I don't see how this polyscripting thing is any better or worse than those dozens of existing mitigation technologies, apart from your point about debugging.
- imtringued 8y agoThe problem with this "mitigation" is that it doesn't solve the problem and it takes away resources and attention from the proper solution. Checking a code signature on file load is a proven mitigation for preventing the execution of untrusted code.
- joshuamorton 8y agoThis doesn't help if the code you're executing changes after execution starts, or if it is dynamically generated (a sql query).
- klodolph 8y agoTo clarify, my comment was suggesting that defense in depth is the correct way to do things (because exploit-free software is too hard to write, as you say). NX bit is a part of that, but polyscripting is stupid and should be thrown away. The problem with polyscripting is that it doesn’t provide any extra benefits that code signing doesn’t give you. In fact, it provides less security, more drawbacks, and has a greater implementation complexity (= attack surface) than code signing. With code signing you can be confident that someone with access to signed code can’t sign their own code, but with polyscripting as presented in the article, there does not appear to be any such assurance. Polyscripting reminds me of all the hackneyed copy-protection or anti-reverse-engineering techniques we saw back in the 90s.