{"id":"CVE-2024-47171","aliases":["CVE-2024-47171","GHSA-g54f-66mw-hv66"],"related":[],"kind":"vulnerability","state":"published","title":"Agnai vulnerable to Relative Path Traversal in Image Upload","summary":"Agnai is an artificial-intelligence-agnostic multi-user, mult-bot roleplaying chat system. A vulnerability in versions prior to 1.0.330 permits attackers to upload image files at attacker-chosen location on the server. This issue can lead to image file uploads to unauthorized or unintended directories, including overwriting of existing images which may be used for defacement. This does not affect `agnai.chat`, installations using S3-compatible storage, or self-hosting that is not publicly exposed. Version 1.0.330 fixes this vulnerability.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Agnai is an artificial-intelligence-agnostic multi-user, mult-bot roleplaying chat system. A vulnerability in versions prior to 1.0.330 permits attackers to upload image files at attacker-chosen location on the server. This issue can lead to image file uploads to unauthorized or unintended directories, including overwriting of existing images which may be used for defacement. This does not affect `agnai.chat`, installations using S3-compatible storage, or self-hosting that is not publicly exposed. Version 1.0.330 fixes this vulnerability.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nA vulnerability has been discovered in **Agnai** that permits attackers to upload image files at attacker-chosen location on the server. This issue can lead to image file uploads to unauthorized or unintended directories, including overwriting of existing images which may be used for defacement.\n\nThis does not affect:\n\n- agnai.chat\n- installations using S3-compatible storage\n- self-hosting that is not publicly exposed\n\n### CWE-35: Path Traversal\n\nhttps://cwe.mitre.org/data/definitions/35.html\n\n### CVSS4.0 - 2.3 Low\n\nCVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N\n\n### Details\n\nThis is a path traversal vulnerability. An attacker can exploit this vulnerability by sending a specially crafted request to the `editCharacter` handler https://github.com/agnaistic/agnai/blob/75abbd5b0f5e48ddecc805365cf1574d05ee1ce5/srv/api/character.ts#L140:\n\n```tsx\nPOST /api/character/28cbe508-2fa9-4890-886e-61d73e22006c%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%61%70%70%2f%64%69%73%74%2f%64%61%6e%79%61%6e%67 HTTP/1.1\n```\n\nThe path traversal character sequence makes it’s way into the `id` variable which is then string interpolated into `filename`. \n\n```jsx\nexport async function entityUpload(kind: string, id: string, attachment?: Attachment) {\n  if (!attachment) return\n  const filename = `${kind}-${id}`\n  return upload(attachment, filename)\n}\n```\n\nhttps://github.com/agnaistic/agnai/blob/75abbd5b0f5e48ddecc805365cf1574d05ee1ce5/srv/api/upload.ts#L55\n\nNo path normalization is conducted nor checked, so attackers can freely manipulate the path which the file is uploaded to.\n\n### Impact\n\nThis vulnerability is classified as a path traversal vulnerability. Attackers can upload image files to arbitrary locations, potentially overwriting critical system image files.\n\n### Credit\nSecurity research in collaboration with Analyst [Danyang Liu (noe223)](https://github.com/noe233) @noe233","format":"markdown","source":"ghsa"},{"lang":"es","text":"Agnai es un sistema de chat multiusuario y multibot que no depende de la inteligencia artificial. Una vulnerabilidad en las versiones anteriores a la 1.0.330 permite a los atacantes cargar archivos de imagen en la ubicación elegida por el atacante en el servidor. Este problema puede provocar que se carguen archivos de imagen en directorios no autorizados o no deseados, incluida la sobrescritura de imágenes existentes que pueden usarse para desfigurar el sistema. Esto no afecta a `agnai.chat`, a las instalaciones que usan almacenamiento compatible con S3 o al alojamiento propio que no está expuesto públicamente. La versión 1.0.330 corrige esta vulnerabilidad.","source":"nvd"}],"published":"2024-09-26T17:21:52.646Z","modified":"2026-06-17T07:56:40.117Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","score":4.3,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-22","CWE-35"],"affected":[{"ranges":[{"version":"< 1.0.330","status":"affected"}],"vendor":"agnaistic","product":"agnai","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.0.330"}],"ecosystem":"npm","package":"agnai","purl":"pkg:npm/agnai","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.0.330"}],"vendor":"agnai","product":"agnai","cpe":"cpe:2.3:a:agnai:agnai:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/agnaistic/agnai/security/advisories/GHSA-g54f-66mw-hv66","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/agnaistic/agnai/blob/75abbd5b0f5e48ddecc805365cf1574d05ee1ce5/srv/api/character.ts#L140:","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/agnaistic/agnai/blob/75abbd5b0f5e48ddecc805365cf1574d05ee1ce5/srv/api/upload.ts#L55","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-47171","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/agnaistic/agnai","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-09-26T17:50:57.850Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-47171","url":"https://www.cve.org/CVERecord?id=CVE-2024-47171","licence":"CVE Terms of Use","modified":"2024-09-26T17:53:23.119Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g54f-66mw-hv66","url":"https://github.com/advisories/GHSA-g54f-66mw-hv66","licence":"CC-BY-4.0","modified":"2024-09-26T21:11:07.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-47171","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-47171","licence":"Public domain","modified":"2026-06-17T07:56:40.117Z"}],"updatedAt":"2026-11-25T22:58:45.803Z","epss":{"score":0.00495,"percentile":0.44057,"date":"2026-12-01T12:00:22.000Z"}}