Severity:

HIGH RISK

(8.2)

XSS in parisneo/lollms AppLollmsMessage.from_dict

CVE-2026-1116

Undergoing Analysis

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting leading to session hijacking and potential account compromise

Severity:

HIGH RISK

(8.2)

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) vulnerability in the AppLollmsMessage.from_dict method allows unsanitized content data from user-controlled input to be deserialized and later rendered as HTML.

When malicious content is viewed in a browser context, injected HTML or JavaScript can execute in the victim's session, potentially leading to account takeover, session hijacking, or self-propagating (wormable) behavior.

Affected context

This vulnerability affects parisneo/lollms deployments that:

  • Accept or process user-supplied data into AppLollmsMessage objects via from_dict
  • Later render the content field in a browser or web view without robust output encoding
  • Persist or relay messages between users or sessions (e.g., chat history, shared messages, logs shown in a UI)

The issue is especially relevant where one user's message content can be displayed to other authenticated users or administrators.

Exploit preconditions

  • Attack surface: Web UI or any browser-based interface that displays AppLollmsMessage.content
  • Required access: Ability to submit or influence message data serialized to a dict and passed into AppLollmsMessage.from_dict (e.g., chat input, API call, imported conversation)
  • Trigger point: Deserialization via from_dict followed by rendering the content field into HTML without proper context-aware encoding
  • Why exploitation is possible: The content field is treated as trusted and inserted into a browser-rendered context without sanitization or HTML/JavaScript escaping, allowing attacker-controlled script execution.

Why this happens

The root cause is the absence of validation, sanitization, or output encoding for the content field when reconstructing AppLollmsMessage instances from user-controlled dictionaries.

The from_dict method effectively rehydrates untrusted data and allows it to propagate into HTML-rendered views without applying context-aware escaping or enforcing a safe subset of markup.

This maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting), where user input is included in a web page without correct encoding or filtering, enabling arbitrary script execution in the browser.

Potential impact

  • Attacker-controlled JavaScript execution in victims' browsers
  • Session hijacking by stealing authentication cookies or tokens (where accessible to JavaScript)
  • Account takeover through scripted actions performed on behalf of the victim
  • Defacement or manipulation of the web UI to mislead users
  • Exfiltration of sensitive data displayed in the affected page or accessible via same-origin APIs
  • Wormable propagation by automatically injecting malicious content into subsequent messages or shared artifacts

General mitigation guidance

Effective mitigation focuses on enforcing strict separation between data and executable content and minimizing trust in user-controlled fields:

  • Apply context-aware output encoding (HTML, attribute, JavaScript, or URL encoding as appropriate) whenever rendering content into a browser view.
  • Treat the content field as untrusted, and prefer escaping by default; only allow deliberate, tightly controlled formatting if required.
  • Where rich text is needed, use a whitelisting/allow-list HTML sanitizer that strips scripts, event handlers, and dangerous attributes.
  • Centralize rendering logic so that any data originating from from_dict passes through consistent encoding/sanitization routines.
  • Avoid mixing structured model deserialization with view rendering concerns; keep deserialization purely data-focused and enforce encoding in the presentation layer.
  • Apply the principle of least privilege in the browser by avoiding exposure of sensitive tokens or APIs to page scripts when possible.

How teams detect issues like this

Organizations can detect and monitor for similar XSS risks through:

  • Static analysis: Rules that flag direct insertion of model fields (such as content) into templates or DOM sinks (innerHTML, v-html, dangerouslySetInnerHTML, etc.) without encoding or sanitization.
  • Code review: Check deserialization paths like from_dict for fields later used in views, verifying that all untrusted data goes through a shared encoding/sanitization layer.
  • Template and component policies: Enforce conventions disallowing raw HTML rendering and requiring explicit safe-render helpers for special cases.
  • Security testing: Fuzz front-end inputs and message-creation APIs with XSS payloads and observe rendered output for unescaped content.
  • Automated pipelines: Integrate SAST/DAST tools and linting rules into CI to surface new or changed code paths that render user-controlled content.

Sources

SourceLink
github.comgithub.com/parisneo/lollms/commit/9767b882dbc893c388a286856beeaead69b8292a
huntr.comhuntr.com/bounties/d3d076a7-2a51-4e07-8d0e-91e28e76788e

Frequently asked

questions

Yes. If an attacker can submit or influence message content that flows through AppLollmsMessage.from_dict and is later viewed in a browser, they can potentially execute JavaScript in the victim's session.

Typically, the attacker must be able to create or modify messages or data structures that are deserialized into AppLollmsMessage objects—such as through a web form, chat interface, or API endpoint that stores and redisplays message content.

The safest approach is to ensure that all user-controlled fields, including content, are properly encoded at render time based on their context in the HTML document, and to use a robust HTML sanitizer when rich text is necessary. The deserialization method should treat input as opaque data and not assume it is safe for direct rendering.

Adopt a development policy where:

  • All untrusted input is escaped by default in the view layer.
  • Dangerous sinks (e.g., innerHTML) are minimized or wrapped with safe helpers.
  • Deserialization routines do not bypass validation/encoding.
  • Security-focused code reviews and automated checks look specifically for unencoded user data being injected into HTML or script contexts.
Find out what's already
exploitable in your codebase.