CVE-2026-54893: Swoosh Swoosh Has Email-derived URL Path Vulnerability

LOW
Advisory Identifier: GHSA-754j-98wh-57rf
CWE-116 CWE-789 CWE-1284
Published
Advisory Summary

CVE-2026-54893 is a LOW swoosh has email-derived url path vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Swoosh libraries in the Hex ecosystem. The issue involves swoosh has email-derived url path injection in microsoft graph endpoint. Remediation is available by upgrading affected packages to version 1.26.3.

CVE-2026-54893 at a Glance

CVE Identifier CVE-2026-54893
GHSA Identifier GHSA-754j-98wh-57rf
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product Swoosh
Package Ecosystem Hex
Published Date
Last Updated

How to Fix CVE-2026-54893

To remediate this vulnerability, upgrade all affected Swoosh dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

swoosh fixed: 1.26.3
Upgrade swoosh to 1.26.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for swoosh

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-54893, inspect your project dependencies for Swoosh:

inspect dependencies for swoosh

Analyze the terminal output to locate any version of Swoosh in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.26.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Swoosh, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary `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. ### Details The 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. Because 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. ### PoC 1. 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). 2. Submit a `from` address whose local part contains URL-special characters, for example one using `/`, `?`, or `#` to escape the `/users/{from}/sendMail` path segment. 3. Trigger delivery; Swoosh interpolates the address unencoded and sends the application's authenticated Graph `POST` to the attacker-rewritten path and query string. ### Impact An 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. ### References * Introduction commit: https://github.com/swoosh/swoosh/commit/23bfcdab71aee4613858ba6d116bb3311b72aa58 * Patch commit: https://github.com/swoosh/swoosh/commit/e38235453e81d1727bfc8d91e69ec4cb211ccf61 * Affected adapter source: https://github.com/swoosh/swoosh/blob/master/lib/swoosh/adapters/ms_graph.ex

CVE-2026-54893 Affected Swoosh Versions

1 component(s)
Fixed Versions:
1.26.3
Product / Package Ecosystem Affected Versions Fixed Version
swoosh
Hex
≥ 1.12.0
< 1.26.3
1.26.3

References

Frequently Asked Questions

What is CVE-2026-54893?
CVE-2026-54893 is a security vulnerability in Swoosh involving swoosh has email-derived URL path injection in Microsoft Graph endpoint under CWE-116: Improper Encoding or Escaping of Output.
Which Swoosh versions are affected?
Affected versions include releases prior to 1.26.3 across affected packages: swoosh.
What version fixes CVE-2026-54893?
Upgrading to 1.26.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is swoosh affected?
Yes, swoosh is affected in releases prior to 1.26.3. Upgrade your dependency to 1.26.3 or later.
What CWE is associated with CVE-2026-54893?
CVE-2026-54893 is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check Hex dependencies for CVE-2026-54893?
Run the dependency tree command: 'inspect dependencies for swoosh'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-754j-98wh-57rf",
  "modified" : "2026-10-16T19:22:31Z",
  "published" : "2026-10-16T19:22:31Z",
  "aliases" : [ "CVE-2026-54893" ],
  "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",
  "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Hex",
      "name" : "swoosh"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.12.0"
      }, {
        "fixed" : "1.26.3"
      } ]
    } ]
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-1284", "CWE-789" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-16T19:22:31Z",
    "nvd_published_at" : "2026-07-06T15:16:39Z"
  }
}