Descrizione
YAML::Syck versions before 1.38 for Perl has an out-of-bounds read.
The base60 (sexagesimal) parsing code in perl_syck.h has a buffer underflow bug in both int#base60 and float#base60 handlers. When processing the leftmost segment of a colon-separated value (e.g., the 1 in 1:30:45), the inner while loop can decrement a pointer past the start of the string buffer:
while ( colon >= ptr && *colon != ':' )
{
colon--;
}
if ( *colon == ':' ) *colon = '\0'; // colon may be ptr-1 here
When no colon is found (final/leftmost segment), colon becomes ptr-1, and the subsequent *colon dereference reads one byte before the allocated buffer.
Tipo di vulnerabilità
CWE-124
Buffer Underwrite
The product writes to a buffer using an index or pointer that references a memory location prior to the beginning of the buffer.
Impatto sui sistemi
| Ambito | Impatto |
| Integrità, Disponibilità |
Modificare la memoria, Interruzione del servizio: arresto o riavvio |
| Integrità, Riservatezza, Disponibilità, Controllo degli accessi, Altro |
Eseguire codice o comandi non autorizzati, Modificare la memoria, Aggirare i meccanismi di protezione, Altro |
| Controllo degli accessi, Altro |
Aggirare i meccanismi di protezione, Altro |
Come si previene
Requisiti
Choose a language that is not susceptible to these issues.
Sviluppo
All calculated values that are used as index or for pointer arithmetic should be validated to ensure that they are within an expected range.
Tutte le 39 CVE di tipo CWE-124, con andamento e prevenzione