CVE-2026-29178: Lemmy routes Lemmy Has Unauthenticated SSRF Vulnerability

HIGH
Advisory Identifier: GHSA-jvxv-2jjp-jxc3
CWE-918
Published
Advisory Summary

CVE-2026-29178 is a HIGH lemmy has unauthenticated ssrf vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Lemmy routes libraries in the crates.io ecosystem. The issue involves lemmy has unauthenticated ssrf via file_type query parameter injection in image endpoint. Remediation is available by upgrading affected packages to version 0.19.16.

CVE-2026-29178 at a Glance

CVE Identifier CVE-2026-29178
GHSA Identifier GHSA-jvxv-2jjp-jxc3
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Lemmy routes
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix CVE-2026-29178

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

lemmy_routes fixed: 0.19.16
Upgrade lemmy_routes to 0.19.16
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 lemmy_routes

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-29178, inspect your project dependencies for Lemmy routes:

inspect dependencies for lemmy_routes

Analyze the terminal output to locate any version of Lemmy routes in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.19.16), 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-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Lemmy routes, 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 The `GET /api/v4/image/{filename}` endpoint is vulnerable to unauthenticated SSRF through parameter injection in the `file_type` query parameter. An attacker can inject arbitrary query parameters into the internal request to pict-rs, including the `proxy` parameter which causes pict-rs to fetch arbitrary URLs. ## Affected code `crates/routes/src/images/download.rs`, lines 17-40 (`get_image` function): ```rust pub async fn get_image( filename: Path<String>, Query(params): Query<ImageGetParams>, req: HttpRequest, context: Data<LemmyContext>, ) -> LemmyResult<HttpResponse> { let name = &filename.into_inner(); let pictrs_url = context.settings().pictrs()?.url; let processed_url = if params.file_type.is_none() && params.max_size.is_none() { format!("{}image/original/{}", pictrs_url, name) } else { let file_type = file_type(params.file_type, name); let mut url = format!("{}image/process.{}?src={}", pictrs_url, file_type, name); // ... }; do_get_image(processed_url, req, &context).await } ``` The `file_type` parameter (`ImageGetParams.file_type: Option<String>`) is directly interpolated into the URL string without any validation or encoding. Since pict-rs's `/image/process.{ext}` endpoint supports a `?proxy={url}` parameter for fetching remote images, an attacker can inject `?proxy=...` via `file_type` to make pict-rs fetch arbitrary URLs. This endpoint does not require authentication (no `LocalUserView` extractor). ## PoC ```bash # Basic SSRF - make pict-rs fetch AWS metadata endpoint # The file_type value is: jpg?proxy=http://169.254.169.254/latest/meta-data&x= # This constructs: http://pictrs:8080/image/process.jpg?proxy=http://169.254.169.254/latest/meta-data&x=?src=anything curl -v 'https://TARGET/api/v4/image/anything?file_type=jpg%3Fproxy%3Dhttp%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data%26x%3D' # Scan internal services on the Docker network curl -v 'https://TARGET/api/v4/image/anything?file_type=jpg%3Fproxy%3Dhttp%3A%2F%2Flemmy%3A8536%2Fapi%2Fv4%2Fsite%26x%3D' # The same issue exists in the image_proxy endpoint, but it requires the # proxy URL to exist in the remote_image table (RemoteImage::validate check), # making it harder to exploit. ``` The response from the internal URL is streamed back to the attacker through pict-rs and Lemmy. ## Impact An unauthenticated attacker can: - Access cloud metadata services (AWS/GCP/Azure instance metadata) from the pict-rs service - Scan and interact with internal services on the Docker network (pict-rs is typically co-located with Lemmy, PostgreSQL, etc.) - Bypass the `RemoteImage::validate()` check that protects the `image_proxy` endpoint ## Suggested Fix Validate the `file_type` parameter to only allow alphanumeric characters: ```rust fn file_type(file_type: Option<String>, name: &str) -> String { let ft = file_type .unwrap_or_else(|| name.split('.').next_back().unwrap_or("jpg").to_string()); if ft.chars().all(|c| c.is_alphanumeric()) { ft } else { "jpg".to_string() } } ```

CVE-2026-29178 Affected Lemmy routes Versions

1 component(s)
Fixed Versions:
0.19.16
Product / Package Ecosystem Affected Versions Fixed Version
lemmy_routes
crates.io
< 0.19.16
0.19.16

References

Frequently Asked Questions

What is CVE-2026-29178?
CVE-2026-29178 is a security vulnerability in Lemmy routes involving Lemmy has unauthenticated SSRF via file_type query parameter injection in image endpoint under CWE-918: Server-Side Request Forgery (SSRF).
Which Lemmy routes versions are affected?
Affected versions include releases prior to 0.19.16 across affected packages: lemmy_routes.
What version fixes CVE-2026-29178?
Upgrading to 0.19.16 (or the latest patched release for your respective branch) resolves the vulnerability.
Is lemmy_routes affected?
Yes, lemmy_routes is affected in releases prior to 0.19.16. Upgrade your dependency to 0.19.16 or later.
What CWE is associated with CVE-2026-29178?
CVE-2026-29178 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check crates.io dependencies for CVE-2026-29178?
Run the dependency tree command: 'inspect dependencies for lemmy_routes'. 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-jvxv-2jjp-jxc3",
  "modified" : "2026-03-06T22:44:31Z",
  "published" : "2026-03-04T20:55:00Z",
  "aliases" : [ "CVE-2026-29178" ],
  "summary" : "Lemmy has unauthenticated SSRF via file_type query parameter injection in image endpoint",
  "details" : "## Summary\n\nThe `GET /api/v4/image/{filename}` endpoint is vulnerable to unauthenticated SSRF through parameter injection in the `file_type` query parameter. An attacker can inject arbitrary query parameters into the internal request to pict-rs, including the `proxy` parameter which causes pict-rs to fetch arbitrary URLs.\n\n## Affected code\n\n`crates/routes/src/images/download.rs`, lines 17-40 (`get_image` function):\n\n```rust\npub async fn get_image(\n  filename: Path<String>,\n  Query(params): Query<ImageGetParams>,\n  req: HttpRequest,\n  context: Data<LemmyContext>,\n) -> LemmyResult<HttpResponse> {\n  let name = &filename.into_inner();\n  let pictrs_url = context.settings().pictrs()?.url;\n  let processed_url = if params.file_type.is_none() && params.max_size.is_none() {\n    format!(\"{}image/original/{}\", pictrs_url, name)\n  } else {\n    let file_type = file_type(params.file_type, name);\n    let mut url = format!(\"{}image/process.{}?src={}\", pictrs_url, file_type, name);\n    // ...\n  };\n  do_get_image(processed_url, req, &context).await\n}\n```\n\nThe `file_type` parameter (`ImageGetParams.file_type: Option<String>`) is directly interpolated into the URL string without any validation or encoding. Since pict-rs's `/image/process.{ext}` endpoint supports a `?proxy={url}` parameter for fetching remote images, an attacker can inject `?proxy=...` via `file_type` to make pict-rs fetch arbitrary URLs.\n\nThis endpoint does not require authentication (no `LocalUserView` extractor).\n\n## PoC\n\n```bash\n# Basic SSRF - make pict-rs fetch AWS metadata endpoint\n# The file_type value is: jpg?proxy=http://169.254.169.254/latest/meta-data&x=\n# This constructs: http://pictrs:8080/image/process.jpg?proxy=http://169.254.169.254/latest/meta-data&x=?src=anything\n\ncurl -v 'https://TARGET/api/v4/image/anything?file_type=jpg%3Fproxy%3Dhttp%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data%26x%3D'\n\n# Scan internal services on the Docker network\ncurl -v 'https://TARGET/api/v4/image/anything?file_type=jpg%3Fproxy%3Dhttp%3A%2F%2Flemmy%3A8536%2Fapi%2Fv4%2Fsite%26x%3D'\n\n# The same issue exists in the image_proxy endpoint, but it requires the\n# proxy URL to exist in the remote_image table (RemoteImage::validate check),\n# making it harder to exploit.\n```\n\nThe response from the internal URL is streamed back to the attacker through pict-rs and Lemmy.\n\n## Impact\n\nAn unauthenticated attacker can:\n- Access cloud metadata services (AWS/GCP/Azure instance metadata) from the pict-rs service\n- Scan and interact with internal services on the Docker network (pict-rs is typically co-located with Lemmy, PostgreSQL, etc.)\n- Bypass the `RemoteImage::validate()` check that protects the `image_proxy` endpoint\n\n## Suggested Fix\n\nValidate the `file_type` parameter to only allow alphanumeric characters:\n\n```rust\nfn file_type(file_type: Option<String>, name: &str) -> String {\n  let ft = file_type\n    .unwrap_or_else(|| name.split('.').next_back().unwrap_or(\"jpg\").to_string());\n  if ft.chars().all(|c| c.is_alphanumeric()) {\n    ft\n  } else {\n    \"jpg\".to_string()\n  }\n}\n```",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "lemmy_routes"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.19.16"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.19.15"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/LemmyNet/lemmy/security/advisories/GHSA-jvxv-2jjp-jxc3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-29178"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/LemmyNet/lemmy/commit/f47a03f56d1797bceab5f34b6f624c91cecd5871"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/LemmyNet/lemmy"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-04T20:55:00Z",
    "nvd_published_at" : "2026-03-06T18:16:20Z"
  }
}