diff --git a/advisories/github-reviewed/2024/09/GHSA-g54f-66mw-hv66/GHSA-g54f-66mw-hv66.json b/advisories/github-reviewed/2024/09/GHSA-g54f-66mw-hv66/GHSA-g54f-66mw-hv66.json new file mode 100644 index 00000000000..eda03221d5a --- /dev/null +++ b/advisories/github-reviewed/2024/09/GHSA-g54f-66mw-hv66/GHSA-g54f-66mw-hv66.json @@ -0,0 +1,70 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-g54f-66mw-hv66", + "modified": "2024-09-26T18:16:13Z", + "published": "2024-09-26T18:16:13Z", + "aliases": [ + "CVE-2024-47171" + ], + "summary": "Agnai vulnerable to Relative Path Traversal in Image Upload", + "details": "### 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", + "severity": [ + { + "type": "CVSS_V3", + "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N" + }, + { + "type": "CVSS_V4", + "score": "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" + } + ], + "affected": [ + { + "package": { + "ecosystem": "npm", + "name": "agnai" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "1.0.330" + } + ] + } + ] + } + ], + "references": [ + { + "type": "WEB", + "url": "https://github.com/agnaistic/agnai/security/advisories/GHSA-g54f-66mw-hv66" + }, + { + "type": "PACKAGE", + "url": "https://github.com/agnaistic/agnai" + }, + { + "type": "WEB", + "url": "https://github.com/agnaistic/agnai/blob/75abbd5b0f5e48ddecc805365cf1574d05ee1ce5/srv/api/character.ts#L140:" + }, + { + "type": "WEB", + "url": "https://github.com/agnaistic/agnai/blob/75abbd5b0f5e48ddecc805365cf1574d05ee1ce5/srv/api/upload.ts#L55" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-22", + "CWE-35" + ], + "severity": "LOW", + "github_reviewed": true, + "github_reviewed_at": "2024-09-26T18:16:13Z", + "nvd_published_at": null + } +} \ No newline at end of file