Suhosin, che cos’è?
Un hardener PHP serve a dare maggiore sicurezza rispetto a problematiche e falle note oppure in casi di codici mal scritti che possono creare possibili brecce sui sistemi. Lascio qui una traduzione semi-automatica della pagina ufficiale di uno di questi famosi sistemi, chiamato Suhosin. Il sito è QUA
Cos’è il Suhosin?
Suhosin (pronunciato “su-ho-shin”) è un sistema avanzato di protezione per le installazioni di PHP 5. È progettato per proteggere server e utenti da difetti noti e sconosciuti nelle applicazioni PHP e nel core PHP. Suhosin è disponibile in due parti indipendenti, che possono essere utilizzate separatamente o in combinazione.
La prima parte è una piccola patch contro il core PHP, che implementa alcune protezioni di basso livello contro i buffer overflow o le vulnerabilità delle stringhe di formato e la seconda parte è una potente estensione PHP che implementa numerose altre protezioni.
Perché Suhosin?
La domanda più importante per i nuovi utenti di Suhosin è, perché dovrebbero usare il Suhosin, se è veramente necessario e cosa ottengono usando la patch, l’estensione o una combinazione di entrambi.
La risposta a questa domanda dipende da cosa è l’utilizzo di PHP. Se stai usando PHP solo per il tuo server e solo per i tuoi script e le tue applicazioni, allora puoi giudicare da solo,
se ti fidi abbastanza del tuo codice. In questo caso probabilmente non hai bisogno dell’estensione di Suhosin. Poiché la maggior parte delle sue funzionalità hanno lo scopo di proteggere i server da tecniche di programmazione vulnerabili. Tuttavia PHP è un linguaggio di programmazione molto complesso con molte insidie che vengono spesso supervisionate durante lo sviluppo delle applicazioni.
Persino i programmatori core di PHP stanno scrivendo di tanto in tanto codice non sicuro, perché non sapevano di una trappola del PHP. Pertanto è sempre una buona idea avere Suhosin come rete di sicurezza. Il Suhosin-
La patch d’altra parte viene fornita con le funzionalità di protezione del motore di Zend che proteggono il server da possibili overflow del buffer e vulnerabilità correlate in Zend Engine. La storia ha dimostrato che molti di questi bug sono sempre esistiti nelle precedenti versioni di PHP.
Se non stai solo eseguendo i tuoi script PHP, ma stai anche ospitando applicazioni PHP di terze parti per te stesso o anche per i possibili clienti, non puoi fidarti della qualità del codice delle applicazioni PHP che usi. Sfortunatamente è un dato di fatto che le insidie del linguaggio PHP non sono molto conosciute tra i programmatori.
Molte di queste insidie non sono documentate nei libri sulla sicurezza di PHP rilasciati durante l’ultimo anno. Ciò è dovuto principalmente al fatto che i libri sono stati scritti in fretta per essere i primi sul mercato e perché la maggior parte di questi libri non è stata scritta da professionisti della sicurezza ma da programmatori PHP.
Il peggiore di questi libri è quello di Oreilly che contiene esempi che potrebbero risolvere il problema descritto ma introduce vulnerabilità più pericolose nella tua applicazione.
Un altro errore comune in questi libri è che diffondono la leggenda metropolitana che il problema più pericoloso all’interno delle “vulnerabilità di inclusione di codice remoto” di PHP può essere risolto disabilitando allow_url_fopen nella configurazione (o allow_url_include in PHP 5.2.x). Questa informazione è semplicemente sbagliata,
perché queste direttive di configurazione NON proteggono dagli attacchi tramite php: // input o data: // URL. Il nostro Suhosin e l’ex Hardening-Patch sono le uniche protezioni disponibili che chiudono tutti gli URL includono gli attacchi.
Riassunto, è la tua libera scelta usare Suhosin. Se desideri una protezione aggiuntiva per i tuoi server e la tua attività,
possiamo solo raccomandare fortemente di usare l’estensione e la patch. Tieni sempre presente che non stai solo proteggendo te stesso e i tuoi utenti, ma anche altre persone su Internet, che potrebbero essere attaccate dal tuo server dopo che è stato trasformato in un drone di attacco (Spam / DDOS-).
What is Suhosin?
Suhosin (pronounced ‘su-ho-shin’) is an advanced protection system for PHP 5 installations. It is designed to protect servers and users from known and unknown flaws in PHP applications and the PHP core. Suhosin comes in two independent parts, that can be used separately or in combination. The first part is a small patch against the PHP core, that implements a few low-level protections against buffer overflows or format string vulnerabilities and the second part is a powerful PHP extension that implements numerous other protections.
Why Suhosin?
The most important question for new users of Suhosin is, why they should use Suhosin at all, if it is really necessary and what they gain by using the patch, the extension or a combination of both.
The answer to this question depends on what your usage of PHP is. If you are using PHP only for your own server and only for your own scripts and applications, then you can judge for yourself, if you trust your code enough. In that case you most probably don’t need the Suhosin extension. Because most of it’s features are meant to protect servers against vulnerable programming techniques. However PHP is a very complex programming language with a lot of pitfalls that are often overseen during the development of applications. Even PHP core programmers are writing insecure code from time to time, because they did not know about a PHP pitfall. Therefore it is always a good idea to have Suhosin as your safety net. The Suhosin-Patch on the other hand comes with Zend Engine Protection features that protect your server from possible buffer overflows and related vulnerabilities in the Zend Engine. History has shown that several of these bugs have always existed in previous PHP versions.
If you are not only running your own PHP scripts but are also hosting 3rd party PHP applications for yourself or even for possible customers, then you cannot trust the code quality of the PHP applications you use. Unfortunately it is a fact that the pitfalls of the PHP language are not widely known among programmers. Many of these pitfalls are also not documented in the PHP-Security books that have been released during the last year. This is mainly caused by the fact, that the books were written in a hurry to be the first in market and because most of these books were not written by security professionals but by PHP programmers. The worst of these books is the one by Oreilly which contains examples that might fix the problem described but introduces more dangerous vulnerabilities into your application.
Another common error in these books is that they spread the urban legend that the most dangerous problem within PHP “remote code inclusion vulnerabilities” can be fixed by disabling allow_url_fopen in the configuration (or allow_url_include in PHP 5.2.x). This information is simply wrong, because these configuration directives do NOT protect against attacks through php://input or data:// URLs. Our Suhosin and the former Hardening-Patch are the only available protections that close all URL include attacks.
Summed up, it is your free choice to use Suhosin. If you want additional protection for your servers and your business, we can only recommend strongly that you use the extension and the patch. Always keep in mind that you are not only protecting yourself and your users, but also other people on the internet, that might get attacked by your server after it has been turned into a (Spam-/DDOS-)attack drone.