{"id":"GHSA-754j-98wh-57rf","summary":"swoosh has email-derived URL path injection in Microsoft Graph endpoint","details":"### Summary\n\n`Swoosh.Adapters.MsGraph` builds its Microsoft Graph API request URL by interpolating the sender's email address directly into the URL path (`/users/{from}/sendMail`) without percent-encoding or validation. In applications that derive the `from` address from untrusted or user-influenced input (a relay, a contact form, or a \"send as\" feature), an attacker can inject URL-special characters into the local part of the address to escape the intended path segment and rewrite the request's path and query string. Because the rewritten request is still sent as the application's authenticated `POST` with its Microsoft Graph bearer token, the attacker can redirect it to other Graph endpoints within the token's scopes.\n\n### Details\n\nThe flaw is in `lib/swoosh/adapters/ms_graph.ex`. `api_endpoint_url/2` constructs the Graph endpoint by interpolating the email's `from` address into the path `/users/{from}/sendMail`. The `from` value is taken verbatim from the email struct and is neither percent-encoded nor validated against the RFC 5321 character set before being placed into the URL. `deliver/2` then issues an authenticated `POST` to that constructed URL using the application's Graph bearer token.\n\nBecause the address sits as the local part of `/users/{from}/sendMail`, characters such as `/`, `?`, and `#` are not neutralized. A `/` lets the attacker append or replace additional path segments, a `?` starts an attacker-controlled query string, and `#` truncates the remainder of the intended path. The result is that the authenticated request can be steered to a different Graph endpoint or carry attacker-chosen query parameters, all under the token's existing scopes. Applications that always send with a fixed, trusted `from` address never reach the injectable path and are unaffected.\n\n### PoC\n\n1. Configure an application to use `Swoosh.Adapters.MsGraph` and derive the email `from` address from user-influenced input (e.g. a contact form's reply address or a \"send as\" field).\n2. Submit a `from` address whose local part contains URL-special characters, for example one using `/`, `?`, or `#` to escape the `/users/{from}/sendMail` path segment.\n3. Trigger delivery; Swoosh interpolates the address unencoded and sends the application's authenticated Graph `POST` to the attacker-rewritten path and query string.\n\n### Impact\n\nAn attacker who can influence the sender address can redirect an application's authenticated Microsoft Graph requests to other endpoints within the bearer token's scopes and control the request's query string, turning the mail-sending path into a constrained server-side request forgery against the Graph API.\n\n### References\n\n* Introduction commit: https://github.com/swoosh/swoosh/commit/23bfcdab71aee4613858ba6d116bb3311b72aa58\n* Patch commit: https://github.com/swoosh/swoosh/commit/e38235453e81d1727bfc8d91e69ec4cb211ccf61\n* Affected adapter source: https://github.com/swoosh/swoosh/blob/master/lib/swoosh/adapters/ms_graph.ex","aliases":["CVE-2026-54893","EEF-CVE-2026-54893"],"modified":"2026-10-16T19:30:04.073329974Z","published":"2026-10-16T19:22:31Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2026-10-16T19:22:31Z","nvd_published_at":"2026-07-06T15:16:39Z","cwe_ids":["CWE-116","CWE-1284","CWE-789"],"severity":"LOW"},"references":[{"type":"WEB","url":"https://github.com/swoosh/swoosh/security/advisories/GHSA-754j-98wh-57rf"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54893"},{"type":"WEB","url":"https://github.com/swoosh/swoosh/commit/23bfcdab71aee4613858ba6d116bb3311b72aa58"},{"type":"WEB","url":"https://github.com/swoosh/swoosh/commit/e38235453e81d1727bfc8d91e69ec4cb211ccf61"},{"type":"WEB","url":"https://cna.erlef.org/cves/CVE-2026-54893.html"},{"type":"PACKAGE","url":"https://github.com/swoosh/swoosh"},{"type":"WEB","url":"https://osv.dev/vulnerability/EEF-CVE-2026-54893"}],"affected":[{"package":{"name":"swoosh","ecosystem":"Hex","purl":"pkg:hex/swoosh"},"ranges":[{"type":"SEMVER","events":[{"introduced":"1.12.0"},{"fixed":"1.26.3"}]}],"versions":["1.12.0","1.13.0","1.14.0","1.14.1","1.14.2","1.14.3","1.14.4","1.15.0","1.15.1","1.15.2","1.15.3","1.16.0","1.16.1","1.16.10","1.16.11","1.16.12","1.16.2","1.16.3","1.16.4","1.16.5","1.16.6","1.16.7","1.16.8","1.16.9","1.17.0","1.17.1","1.17.10","1.17.2","1.17.3","1.17.4","1.17.5","1.17.6","1.17.7","1.17.8","1.17.9","1.18.0","1.18.1","1.18.2","1.18.3","1.18.4","1.19.0","1.19.1","1.19.2","1.19.3","1.19.4","1.19.5","1.19.6","1.19.7","1.19.8","1.19.9","1.20.0","1.20.1","1.21.0","1.22.0","1.22.1","1.23.0","1.23.1","1.24.0","1.25.0","1.25.1","1.25.2","1.25.3","1.26.0","1.26.1","1.26.2"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-754j-98wh-57rf/GHSA-754j-98wh-57rf.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N"}]}