Descrizione
An issue was discovered in Asterisk Open Source 11.x before 11.25.1, 13.x before 13.13.1, and 14.x before 14.2.1 and Certified Asterisk 11.x before 11.6-cert16 and 13.x before 13.8-cert4. The chan_sip channel driver has a liberal definition for whitespace when attempting to strip the content between a SIP header name and a colon character. Rather than following RFC 3261 and stripping only spaces and horizontal tabs, Asterisk treats any non-printable ASCII character as if it were whitespace. This means that headers such as Contact\x01: will be seen as a valid Contact header. This mostly does not pose a problem until Asterisk is placed in tandem with an authenticating SIP proxy. In such a case, a crafty combination of valid and invalid To headers can cause a proxy to allow an INVITE request into Asterisk without authentication since it believes the request is an in-dialog request. However, because of the bug described above, the request will look like an out-of-dialog request to Asterisk. Asterisk will then process the request as a new call. The result is that Asterisk can process calls from unvetted sources without any authentication. If you do not use a proxy for authentication, then this issue does not affect you. If your proxy is dialog-aware (meaning that the proxy keeps track of what dialogs are currently valid), then this issue does not affect you. If you use chan_pjsip instead of chan_sip, then this issue does not affect you.
Tipo di vulnerabilità
CWE-285
Autorizzazione impropria
Il prodotto non esegue, o esegue in modo errato, il controllo delle autorizzazioni quando un soggetto tenta di accedere a una risorsa o di compiere un’azione.
Impatto sui sistemi
| Ambito | Impatto |
| Riservatezza |
Leggere i dati dell’applicazione, Leggere file o cartelle |
| Integrità |
Modificare i dati dell’applicazione, Modificare file o cartelle |
| Controllo degli accessi |
Ottenere privilegi o assumere un’altra identità, Eseguire codice o comandi non autorizzati |
Come si previene
Architettura e progettazione
Dividi il prodotto in aree anonime, normali, privilegiate e amministrative. Riduci la superficie di attacco associando con cura ruoli, dati e funzioni, e usa un controllo degli accessi basato sui ruoli (RBAC) per far rispettare i ruoli nei punti giusti. Questo approccio non protegge dall’accesso «orizzontale»: non impedisce a un utente di attaccare altri utenti con lo stesso ruolo.
Architettura e progettazione
Ensure that you perform access control checks related to your business logic. These checks may be different than the access control checks that you apply to more generic resources such as files, connections, processes, memory, and database records. For example, a database may restrict access for medical records to a specific database user, but each record might only be intended to be accessible to the patient and the patient's doctor.
Architettura e progettazione · Librerie o framework
Usa una libreria o un framework collaudato che non permetta questo tipo di errore o che renda più facile evitarlo. Per esempio, valuta framework di autorizzazione come JAAS Authorization Framework e la funzione Access Control di OWASP ESAPI.
Architettura e progettazione
Nelle applicazioni web, verifica che il controllo degli accessi sia applicato correttamente lato server su ogni pagina: gli utenti non devono poter raggiungere funzioni o informazioni non autorizzate semplicemente richiedendo la pagina direttamente. Un modo per farlo è non mettere in cache le pagine con informazioni sensibili e consentirne l’accesso solo alle richieste accompagnate da un token di sessione attivo e autenticato, associato a un utente con i permessi necessari.
Configurazione del sistema · Installazione
Usa le funzioni di controllo degli accessi del sistema operativo e del server e definisci di conseguenza le liste di controllo degli accessi (ACL), partendo da una politica di negazione predefinita.
Tutte le 1.218 CVE di tipo CWE-285, con andamento e prevenzione