Why is it that server admins do not code sign the contents of their webservers (all php, css, js, etc.) and have Apache / NGINX / whatever server software refuse to execute or serve any code / content unless it has been digitally signed by a certificate held only by the website administrators?

Exceptions could be made for user uploaded content like photos, and exec and shell_exec could be made to enforce digital signature verification for any "images" / code they execute.

Why is this not common practice? It certainly wouldn't stop all attacks - SQL injection and XSS would be essentially unaffected, but it could immediately stop almost all remote code execution attacks and website defacing. Is there some downside I am missing? It seems so simple and effective.

  • What mechanisms exist to enforce this? – Xander Feb 22 at 21:50
  • 6
    Most attacks that would let an attacker replace/modify the files in question would also let them reconfigure the server to disable the protection. – Joseph Sible-Reinstate Monica Feb 23 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.