CVE-2024-56828
JSON

9.8critical

File Upload vulnerability in ChestnutCMS through 1.5.0.

Severity
9.8critical CVSS:3.1 by CISA-ADP
Exploit likelihood
0.91% (higher than 60% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre

Description

File Upload vulnerability in ChestnutCMS through 1.5.0. Based on the code analysis, it was determined that the /api/member/avatar API endpoint receives a base64 string as input. This string is then passed to the memberService.uploadAvatarByBase64 method for processing. Within the service, the base64-encoded image is parsed. For example, given a string like: data:image/html;base64,PGh0bWw+PGltZyBzcmM9eCBvbmVycm9yPWFsZXJ0KDEpPjwvaHRtbD4= the content after the comma is extracted and decoded using Base64.getDecoder().decode(). The substring from the 11th character up to the first occurrence of a semicolon (;) is assigned to the suffix variable (representing the file extension). The decoded content is then written to a file. However, the file extension is not validated, and since this functionality is exposed to the frontend, it poses significant security risks.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
1000mz chestnutcmsup to 1.5.0NVD

Classification

CWE-434

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.

What each source says

CVE List

File Upload vulnerability in ChestnutCMS through 1.5.0. Based on the code analysis, it was determined that the /api/member/avatar API endpoint receives a base64 string as input. This string is then passed to the memberService.uploadAvatarByBase64 method for processing. Within the service, the base64-encoded image is parsed. For example, given a string like: data:image/html;base64,PGh0bWw+PGltZyBzcmM9eCBvbmVycm9yPWFsZXJ0KDEpPjwvaHRtbD4= the content after the comma is extracted and decoded using Base64.getDecoder().decode(). The substring from the 11th character up to the first occurrence of a semicolon (;) is assigned to the suffix variable (representing the file extension). The decoded content is then written to a file. However, the file extension is not validated, and since this functionality is exposed to the frontend, it poses significant security risks.

NVD (es)

Vulnerabilidad de carga de archivos en ChestnutCMS hasta la versión 1.5.0. Según el análisis del código, se determinó que el endpoint de la API /api/member/avatar recibe una cadena base64 como entrada. Esta cadena se pasa luego al método memberService.uploadAvatarByBase64 para su procesamiento. Dentro del servicio, se analiza la imagen codificada en base64. Por ejemplo, dada una cadena como: data:image/html;base64,PGh0bWw+PGltZyBzcmM9eCBvbmVycm9yPWFsZXJ0KDEpPjwvaHRtbD4= el contenido después de la coma se extrae y se decodifica utilizando Base64.getDecoder().decode(). La subcadena desde el undécimo carácter hasta la primera aparición de un punto y coma (;) se asigna a la variable de sufijo (que representa la extensión del archivo). Luego, el contenido decodificado se escribe en un archivo. Sin embargo, la extensión del archivo no está validada y, dado que esta funcionalidad está expuesta al frontend, plantea riesgos de seguridad importantes.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-56828 changed 2025-01-14CVE Terms of Use
NVDCVE-2024-56828 changed 2026-06-17Public domain