Severity:

HIGH RISK

(8.3)

Broken Access Control / Missing Authorization

CVE-2026-0562

Modified

Vulnerability type

Category:

Broken Access Control / Missing Authorization

CWE:

CWE-863

Impact:

Unauthorized Account Actions and Privacy Violations

Severity:

HIGH RISK

(8.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A missing authorization check in the respond_request() handler of parisneo/lollms allows any authenticated user to accept or reject friend requests that belong to other users.

By abusing the /api/friends/requests/{friendship_id} endpoint, an attacker can perform Insecure Direct Object Reference (IDOR) actions on arbitrary friendship records, leading to unauthorized changes in social relationships and exposure of private interactions.

Affected context

This vulnerability appears in the backend friendship management logic of Lollms, specifically in the friends API router handling request responses.

It manifests when:

  • The application relies solely on authentication (logged-in status) without verifying that the caller owns or is part of the targeted friendship record.
  • The endpoint /api/friends/requests/{friendship_id} directly uses the friendship_id from the path to select and update friendship state.
  • There is no additional check to ensure that the authenticated user is either the requester or the recipient associated with that friendship.

Under these conditions, any authenticated user who can guess or enumerate valid friendship_id values may tamper with relationships between other users.

Exploit preconditions

  • Attack surface: HTTP API exposed by the Lollms backend, specifically the /api/friends/requests/{friendship_id} endpoint.
  • Required access: Valid authenticated account on the application (no special roles required).
  • Trigger point: Sending a crafted request (e.g., POST/PUT/PATCH, depending on implementation) to respond_request() with a friendship_id that does not belong to the attacker.
  • Why exploitation is possible: The handler updates the friendship record based solely on the provided friendship_id and does not verify that the authenticated user is the requester or intended recipient, enabling Insecure Direct Object Reference (IDOR) behavior.

Why this happens

The root cause is a classic broken access control pattern where authorization is not enforced at the object level.

The respond_request() function accepts a friendship_id identifier and performs state changes—such as accepting or rejecting a friend request—without confirming that the current user is associated with that specific friendship record.

This maps to CWE-863: Incorrect Authorization, where the application validates that a user is authenticated but fails to verify that they are authorized to act on the targeted resource.

At a design level, the backend couples business actions directly to identifiers provided by clients, assuming those identifiers always refer to objects owned by the caller, instead of deriving or validating ownership based on the authenticated user context.

Potential impact

  • Unauthorized acceptance or rejection of friend requests between other users.
  • Manipulation of social graphs, including forcing unintended connections or blocking legitimate ones.
  • Privacy violations by exposing relationship status or interaction patterns between users.
  • Facilitation of social engineering attacks by creating or removing relationships to increase trust or reduce suspicion.
  • Undermining of audit trails and trust in account activity, as actions appear to originate from legitimate recipients.

General mitigation guidance

Effective mitigation centers on enforcing strict, user-centric authorization for all object-level operations in the friendship system:

  • Implement ownership/participation checks in the respond_request() handler so that only the requester or intended recipient of a friendship can modify its state.
  • Derive target objects through the authenticated user context (e.g., "select friendship where id = X AND user is participant") instead of trusting raw identifiers from the client.
  • Apply a consistent authorization layer or middleware that validates access to domain entities (friendships, messages, profiles) before performing updates.
  • Use clear authorization models (e.g., role- and relationship-based access control) to specify who can perform which action on which object.
  • Fail securely by default: when ownership or participation cannot be proven, deny the operation and avoid leaking details about the resource.
  • Minimize exposure of internal identifiers where possible, or pair them with unguessable tokens to reduce enumeration risk—while still enforcing full authorization checks.

How teams detect issues like this

Detecting similar issues involves both preventive and detective controls:

  • Static analysis and code scanning: Flag endpoints that:
  • Update or delete records based solely on client-supplied identifiers.
  • Lack explicit authorization checks tying resources to the current user or role.
  • Code review practices: During review of controller/router logic:
  • Verify that every handler touching user-linked resources includes ownership or relationship checks.
  • Look for direct ORM calls like get(id=...) immediately followed by updates, without additional filters on the authenticated user.
  • Security testing: Use targeted access control tests and automated API fuzzing to:
  • Attempt cross-user actions by reusing identifiers from one account in another.
  • Confirm that operations on friendships fail when initiated by non-participants.
  • Policy enforcement: Incorporate security guidelines into development standards and CI checks, requiring explicit authorization steps for any endpoint that accepts resource identifiers from clients.

Sources

SourceLink
github.comgithub.com/parisneo/lollms/commit/c46297799f8e1e23305373f8350746b905e0e83c
huntr.comhuntr.com/bounties/6aab01ca-a138-4a1d-bef9-3bce145359bf
aydinnyunus.github.ioaydinnyunus.github.io/2026/04/18/idor-lollms-friend-request-cve-2026-0562/

Frequently asked

questions

Yes. Any remote user who can authenticate to the application and reach the friendship API can attempt to exploit the flaw by targeting friendship IDs that do not belong to them.

No. The issue involves horizontal privilege escalation: a regular authenticated user can act on friendship records associated with other users, without needing special roles or administrator permissions.

Enforce strict object-level authorization checks. For each friendship operation, ensure that the authenticated user is either the requester or the intended recipient, typically by querying friendships with filters on both the friendship_id and the current user identity and denying the action if no match is found.

Adopt a consistent access control strategy where:

  • Every endpoint that acts on user-linked data validates ownership or appropriate relationship.
  • Authorization is centralized into reusable policies or middleware.
  • Security-focused reviews and automated tests explicitly cover cross-user access attempts for each new API route.
Find out what's already
exploitable in your codebase.