Severity:

CRITICAL RISK

(9.6)

Cross-Site Scripting (XSS) in Lollms Social Home Feed

CVE-2026-1115

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Account Takeover and Session Hijacking via Stored XSS

Severity:

CRITICAL RISK

(9.6)

CVSS version:

3.0

Catch this CVE while code is being written

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

Summary

A stored Cross-Site Scripting (XSS) flaw in the Lollms social feature allows user-supplied post content to be saved and later rendered without sanitization.

When malicious posts are viewed in the Home Feed, attacker-controlled JavaScript can execute in other users' browsers, including administrators, enabling account takeover and session hijacking.

Affected context

This vulnerability occurs in the social posting feature where users create content that is later displayed in the Home Feed.

It manifests when the application:

  • Accepts arbitrary HTML or script-capable content in posts
  • Stores that content directly in the DBPost model
  • Renders it back in user browsers without proper HTML encoding or sanitization

Any deployment where untrusted users can create posts that are visible to others, including privileged users, is potentially affected.

Exploit preconditions

  • Attack surface: Web interface for creating social posts (e.g., create_post endpoint).
  • Required access: Ability to create or modify a post (typically any authenticated user, depending on how posting is gated).
  • Trigger point: Viewing the Home Feed or any UI component that renders the stored post content in a browser.
  • Why exploitation is possible: User-controlled content is written directly into the DBPost model and later rendered into HTML without context-aware escaping or sanitization, allowing embedded JavaScript to run in the victim's browser.

Why this happens

The root cause is improper neutralization of user-supplied input before including it in a web page, as described by CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

The create_post function assigns raw user input directly to the persistent DBPost entity, and the template or response layer subsequently injects this content into the page without robust, context-aware output encoding.

Because the application treats user content as trusted markup, it effectively grants attackers the ability to inject script-capable payloads into pages viewed by other users, breaking the browser's same-origin trust model.

Potential impact

  • Attackers may execute arbitrary JavaScript in other users' browsers.
  • Attackers could hijack active sessions by stealing session identifiers or authentication tokens.
  • Malicious scripts can perform actions on behalf of victims, leading to account takeover.
  • Wormable behavior is possible, where malicious posts auto-generate further posts to propagate the exploit.
  • Sensitive data displayed or accessible in the UI (messages, profile data, administrative views) can be exfiltrated.
  • Administrative accounts may be compromised, enabling deeper configuration changes or data access.

General mitigation guidance

Effective mitigation focuses on treating all user-generated content as untrusted and ensuring it cannot introduce active scripting into rendered pages.

Common defensive patterns include:

  • Applying strict, context-aware output encoding for any user-controlled data rendered into HTML, attributes, URLs, or JavaScript contexts.
  • Using a vetted HTML sanitizer for fields that must support rich text, configured to strip or neutralize script-capable constructs (e.g., <script>, event handlers, javascript: URLs).
  • Favoring "plain text by default," only allowing markup in carefully controlled contexts.
  • Implementing a Content Security Policy (CSP) that disallows inline scripts and restricts script sources to trusted origins to limit impact if XSS occurs.
  • Segregating highly privileged interfaces (e.g., admin views) and minimizing exposure to untrusted user-generated content.
  • Applying least-privilege principles to session scopes and tokens, so a compromised session yields minimal damage.

How teams detect issues like this

Detection typically involves a combination of static analysis, review, and runtime testing:

  • Static analysis rules that flag direct injection of request parameters or model fields into HTML templates without encoding.
  • Code review checklists that require verification of output encoding for all user-controlled fields in views and templates, especially social or content-creation features.
  • Security testing using automated scanners or browser-based tools to probe form fields and content inputs for reflected and stored XSS behaviors.
  • Unit and integration tests that assert HTML-escaped output for representative user inputs, including characters like <, >, ", ', and event-handler attributes.
  • Policy enforcement in CI/CD pipelines to block merges when patterns of raw HTML injection or disabled sanitization are detected.

Sources

SourceLink
github.comgithub.com/parisneo/lollms/commit/9767b882dbc893c388a286856beeaead69b8292a
huntr.comhuntr.com/bounties/099aa4fe-7165-4337-889c-3fb4f1aa71aa

Frequently asked

questions

Yes. Any remote user who can submit a post or content to the affected social feature can potentially store malicious script that executes when other users load the Home Feed.

The required access level depends on how posting is configured. If any authenticated user can create posts, then any such user could exploit this issue. If posting is available to anonymous users, the threat expands to anyone who can reach the endpoint.

Apply robust, context-aware output encoding for all user-supplied fields rendered into pages, and introduce a strict HTML sanitization layer for any content that must support rich formatting. Design the system so that user content is treated as plain text by default, with no ability to introduce active scripts.

Adopt a secure templating approach that encodes output by default, mandate XSS-focused code review checks for any feature rendering user-generated content, and complement this with automated testing and a restrictive Content Security Policy. Regularly train developers on XSS patterns and enforce secure-by-default coding standards for web output.

Find out what's already
exploitable in your codebase.