Agnai File Disclosure Vulnerability: JSON via Path Traversal
CWE-35: Path Traversal
https://cwe.mitre.org/data/definitions/35.html
CVSSv3.1 4.3 - Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
Summary
A vulnerability has been discovered in Agnai that permits attackers to read arbitrary JSON files at attacker-chosen locations on the server. This issue can lead to unauthorized access to sensitive information and exposure of confidential configuration files.
This only affects installations with JSON_STORAGE enabled which is intended to local/self-hosting only.
Details & PoC
This is a path traversal vulnerability. An attacker can exploit this vulnerability by sending a specially crafted request:
GET /api/json/messages/%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%61%70%70%2fpackage HTTP/1.1
In this example, the attacker retrieves the package.json file content from the server by manipulating the file path.
The request is processed by the loadMessages handler in agnai/srv/api/json/index.ts and a file is read and returned to the client. The read filename is constructed using string interpolation, with no guard or check for path traversal: https://github.com/agnaistic/agnai/blob/2b878b7ca66471c5dd080197ad9ca2f7f0022655/srv/api/json/index.ts#L77
Constraints
Environment constraints: JSON Storage enabled (non standard)
Impact
This vulnerability is classified as a path traversal vulnerability. Specifically, any JSON file on the server which the webserver process has read privileges for, can be disclosed to the attacker.
Credit
- @ropwareJB
- @noe233
Software afectado
Haz clic en una tecnología para ver todas sus vulnerabilidades.
| Plataforma | Paquete | Versiones vulnerables | Corregida en |
|---|---|---|---|
| Paquete de npm | agnai | < 1.0.330 | 1.0.330 |
Referencias
- Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N- Debilidad (CWE)
CWE-22, CWE-35- Plataforma
- npm
- Paquete
agnai- Publicada
- 26.09.2024
- Actualizado
- 11.10.2026 10:22
Fuentes y licencias
OSV / GitHub Advisory Database - GHSA-h355-hm5h-cm8h - CC BY 4.0
Historial de vulnerabilidades: agnai
Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.
- Entradas en total
- 3
- Primera → última
- 09.2024 09.2024
- Sin corrección
- 0
- Explotada en ataques
- 0
Distribución por gravedad
- Crítica 1
- Baja 2
Divulgaciones por año
- 2024: 3
- 2025: 0
- 2026: 0
-
Agnai File Disclosure Vulnerability: JSON via Path Traversal esta entrada
Identifica las vulnerabilidades de tu aplicación
Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.