CVE-2023-48240: Xwiki platform diff xml Cookies Are Sent To External Vulnerability

CRITICAL
Advisory Identifier: GHSA-7rfg-6273-f5wp
CVSS 9.0
CWE-918 CWE-201
Published
Advisory Summary

CVE-2023-48240 is a CRITICAL (CVSS 9.0) cookies are sent to external vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Xwiki platform diff xml libraries in the Maven ecosystem. The issue involves cookies are sent to external images in rendered diff (and server side request forgery). Remediation is available by upgrading affected packages to version 14.10.15, 15.5.1, 15.6.

CVE-2023-48240 at a Glance

CVE Identifier CVE-2023-48240
GHSA Identifier GHSA-7rfg-6273-f5wp
Severity CRITICAL
CVSS v3.1 Base Score 9.0
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Xwiki platform diff xml
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.0

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2023-48240

To remediate this vulnerability, upgrade all affected Xwiki platform diff xml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.xwiki.platform:xwiki-platform-diff-xml fixed: 14.10.15
<dependency>
    <groupId>org.xwiki.platform</groupId>
    <artifactId>xwiki-platform-diff-xml</artifactId>
    <version>14.10.15</version>
</dependency>
org.xwiki.platform:xwiki-platform-diff-xml fixed: 15.5.1
<dependency>
    <groupId>org.xwiki.platform</groupId>
    <artifactId>xwiki-platform-diff-xml</artifactId>
    <version>15.5.1</version>
</dependency>
org.xwiki.platform:xwiki-platform-diff-xml fixed: 15.6
<dependency>
    <groupId>org.xwiki.platform</groupId>
    <artifactId>xwiki-platform-diff-xml</artifactId>
    <version>15.6</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.xwiki.platform

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2023-48240, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.xwiki.platform

Analyze the terminal output to locate any version of Xwiki platform diff xml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 14.10.15), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.xwiki.platform command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Xwiki platform diff xml, 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

### Impact The rendered diff in XWiki embeds images to be able to compare the contents and not display a difference for an actually unchanged image. For this, XWiki requests all embedded images on the server side. These requests are also sent for images from other domains and include all cookies that were sent in the original request to ensure that images with restricted view right can be compared. This allows an attacker to steal login and session cookies that allow impersonating the current user who views the diff. The attack can be triggered with an image that references the rendered diff, thus making it easy to trigger. More concretely, to reproduce, add 101 different images with references to the attacker's server. In any place add an image with a reference to `/xwiki/bin/view/Image%20Cookie%20Test/?xpage=changes&rev1=1.1&rev2=2.1&include=renderedChanges` where `Image%20Cookie%20Test` needs to be replaced by the path to the document with the images and the two revisions should match the revision before/after adding the images. Whenever a user views that image, the user's login cookies should be sent to the attacker's server. The 101 images are to circumvent the cache that has a default maximum size of 100 entries. Apart from stealing login cookies, this also allows server-side request forgery (the result of any successful request is returned in the image's source) and viewing protected content as once a resource is cached, it is returned for all users. As only successful requests are cached, the cache will be filled by the first user who is allowed to access the resource. ### Patches This has been patched in XWiki 14.10.15, 15.5.1 and 15.6. The rendered diff now only downloads images from trusted domains. Further, cookies are only sent when the image's domain is the same the requested domain. The cache has been changed to be specific for each user. ### Workarounds As a workaround, the image embedding feature can be disabled by deleting `xwiki-platform-diff-xml-<version>.jar` in `WEB-INF/lib/`. ### References * https://jira.xwiki.org/browse/XWIKI-20818 * https://github.com/xwiki/xwiki-platform/commit/bff0203e739b6e3eb90af5736f04278c73c2a8bb

CVE-2023-48240 Affected Xwiki platform diff xml Versions

3 component(s)
Fixed Versions:
14.10.1515.5.115.6
Product / Package Ecosystem Affected Versions Fixed Version
org.xwiki.platform:xwiki-platform-diff-xml
Maven
≥ 11.10.1
< 14.10.15
14.10.15
org.xwiki.platform:xwiki-platform-diff-xml
Maven
≥ 15.0-rc-1
< 15.5.1
15.5.1
org.xwiki.platform:xwiki-platform-diff-xml
Maven
≥ 15.6-rc-1
< 15.6
15.6

References

Frequently Asked Questions

What is CVE-2023-48240?
CVE-2023-48240 is a security vulnerability in Xwiki platform diff xml involving Cookies are sent to external images in rendered diff (and server side request forgery) under CWE-918: Server-Side Request Forgery (SSRF).
Which Xwiki platform diff xml versions are affected?
Affected versions include releases prior to 14.10.15, 15.5.1, 15.6 across affected packages: org.xwiki.platform:xwiki-platform-diff-xml.
What version fixes CVE-2023-48240?
Upgrading to 14.10.15, 15.5.1, 15.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is xwiki-platform-diff-xml affected?
Yes, org.xwiki.platform:xwiki-platform-diff-xml is affected in releases prior to 14.10.15, 15.5.1, 15.6. Upgrade your dependency to 14.10.15, 15.5.1, 15.6 or later.
What is the CVSS score of CVE-2023-48240?
CVE-2023-48240 has a CVSS v3.1 base score of 9.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2023-48240?
CVE-2023-48240 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check Maven dependencies for CVE-2023-48240?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.xwiki.platform'. 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-7rfg-6273-f5wp",
  "modified" : "2023-11-20T21:00:05Z",
  "published" : "2023-11-20T21:00:05Z",
  "aliases" : [ "CVE-2023-48240" ],
  "summary" : "Cookies are sent to external images in rendered diff (and server side request forgery)",
  "details" : "### Impact\nThe rendered diff in XWiki embeds images to be able to compare the contents and not display a difference for an actually unchanged image. For this, XWiki requests all embedded images on the server side. These requests are also sent for images from other domains and include all cookies that were sent in the original request to ensure that images with restricted view right can be compared. This allows an attacker to steal login and session cookies that allow impersonating the current user who views the diff. The attack can be triggered with an image that references the rendered diff, thus making it easy to trigger.\n\nMore concretely, to reproduce, add 101 different images with references to the attacker's server. In any place add an image with a reference to `/xwiki/bin/view/Image%20Cookie%20Test/?xpage=changes&rev1=1.1&rev2=2.1&include=renderedChanges` where `Image%20Cookie%20Test` needs to be replaced by the path to the document with the images and the two revisions should match the revision before/after adding the images. Whenever a user views that image, the user's login cookies should be sent to the attacker's server. The 101 images are to circumvent the cache that has a default maximum size of 100 entries.\n\nApart from stealing login cookies, this also allows server-side request forgery (the result of any successful request is returned in the image's source) and viewing protected content as once a resource is cached, it is returned for all users. As only successful requests are cached, the cache will be filled by the first user who is allowed to access the resource.\n\n### Patches\nThis has been patched in XWiki 14.10.15, 15.5.1 and 15.6. The rendered diff now only downloads images from trusted domains. Further, cookies are only sent when the image's domain is the same the requested domain. The cache has been changed to be specific for each user.\n\n### Workarounds\nAs a workaround, the image embedding feature can be disabled by deleting `xwiki-platform-diff-xml-<version>.jar` in `WEB-INF/lib/`.\n\n### References\n* https://jira.xwiki.org/browse/XWIKI-20818\n* https://github.com/xwiki/xwiki-platform/commit/bff0203e739b6e3eb90af5736f04278c73c2a8bb",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.platform:xwiki-platform-diff-xml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.10.1"
      }, {
        "fixed" : "14.10.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.platform:xwiki-platform-diff-xml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "15.0-rc-1"
      }, {
        "fixed" : "15.5.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.platform:xwiki-platform-diff-xml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "15.6-rc-1"
      }, {
        "fixed" : "15.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-7rfg-6273-f5wp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-48240"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/xwiki/xwiki-platform/commit/bff0203e739b6e3eb90af5736f04278c73c2a8bb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/xwiki/xwiki-platform"
  }, {
    "type" : "WEB",
    "url" : "https://jira.xwiki.org/browse/XWIKI-20818"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-201", "CWE-918" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-11-20T21:00:05Z",
    "nvd_published_at" : "2023-11-20T18:15:07Z"
  }
}