Descrizione
XWiki is a generic wiki platform. In XWiki 16.10.0, required rights were introduced as a way to limit which rights a document can have. Part of the security model of required rights is that a user who doesn't have a right also cannot define that right as required right. That way, users who are editing documents on which required rights are enforced can be sure that they're not giving a right to a script or object that it didn't have before. A bug in the implementation of the enforcement of this rule means that in fact, it was possible for any user with edit right on a document to set programming right as required right. If then a user with programming right edited that document, the content of that document would gain programming right, allowing remote code execution. This thereby defeats most of the security benefits of required rights. As XWiki still performs the required rights analysis when a user edits a page even when required rights are enforced, the user with programming right would still be warned about the dangerous content unless the attacker managed to bypass this check. Note also that none of the affected versions include a UI for enabling the enforcing of required rights so it seems unlikely that anybody relied on them for security in the affected versions. As this vulnerability provides no additional attack surface unless all documents in the wiki enforce required rights, we consider the impact of this attack to be low even though gaining programming right could have a high impact. This vulnerability has been patched in XWiki 16.10.4 and 17.1.0RC1. No known workarounds are available except for upgrading.
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.223 CVE di tipo CWE-285, con andamento e prevenzione