CVE-2022-24897: Xwiki commons velocity Arbitrary Filesystem Write Access From Vulnerability
HIGHCVE-2022-24897 is a HIGH (CVSS 7.5) arbitrary filesystem write access from vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting Xwiki commons velocity libraries in the Maven ecosystem. The issue involves arbitrary filesystem write access from velocity.. Remediation is available by upgrading affected packages to version 12.6.7, 12.10.3.
CVE-2022-24897 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-24897
To remediate this vulnerability, upgrade all affected Xwiki commons velocity dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-velocity</artifactId>
<version>12.6.7</version>
</dependency>
<dependency>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-velocity</artifactId>
<version>12.10.3</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.xwiki.commons
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2022-24897, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.xwiki.commons
Analyze the terminal output to locate any version of Xwiki commons velocity in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 12.6.7), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.xwiki.commons 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-668: Exposure of Resource to Wrong Sphere, where the product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. In Xwiki commons velocity, 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
CVE-2022-24897 Affected Xwiki commons velocity Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.xwiki.commons:xwiki-commons-velocity
|
Maven |
≥ 2.3.0
< 12.6.7
|
12.6.7
|
|
org.xwiki.commons:xwiki-commons-velocity
|
Maven |
≥ 12.7.0
< 12.10.3
|
12.10.3
|
References
Frequently Asked Questions
What is CVE-2022-24897?
Which Xwiki commons velocity versions are affected?
What version fixes CVE-2022-24897?
Is xwiki-commons-velocity affected?
What is the CVSS score of CVE-2022-24897?
What CWE is associated with CVE-2022-24897?
How can I check Maven dependencies for CVE-2022-24897?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cvx5-m8vg-vxgc",
"modified" : "2022-04-28T21:16:40Z",
"published" : "2022-04-28T21:16:40Z",
"aliases" : [ "CVE-2022-24897" ],
"summary" : "Arbitrary filesystem write access from velocity.",
"details" : "### Impact\n\nThe velocity scripts is not properly sandboxed against using the Java File API to perform read or write operations on the filesystem. Now writing an attacking script in velocity requires the Script rights in XWiki so not all users can use it, and it also requires finding an XWiki API which returns a File. \n\n### Patches\nThe problem has been patched on versions 12.6.7, 12.10.3 and 13.0RC1.\n\n### Workarounds\nThere's no easy workaround for fixing this vulnerability other than upgrading and being careful when giving Script rights.\n\n### References\nhttps://jira.xwiki.org/browse/XWIKI-5168\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [Jira XWiki](https://jira.xwiki.org)\n* Email us at [XWiki Security mailing-list](mailto:security@xwiki.org)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.xwiki.commons:xwiki-commons-velocity"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.3.0"
}, {
"fixed" : "12.6.7"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.xwiki.commons:xwiki-commons-velocity"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "12.7.0"
}, {
"fixed" : "12.10.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/xwiki/xwiki-commons/security/advisories/GHSA-cvx5-m8vg-vxgc"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24897"
}, {
"type" : "WEB",
"url" : "https://github.com/xwiki/xwiki-commons/pull/127"
}, {
"type" : "WEB",
"url" : "https://github.com/xwiki/xwiki-commons/commit/215951cfb0f808d0bf5b1097c9e7d1e503449ab8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/xwiki/xwiki-commons"
}, {
"type" : "WEB",
"url" : "https://jira.xwiki.org/browse/XWIKI-5168"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22", "CWE-668" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-04-28T21:16:40Z",
"nvd_published_at" : "2022-05-02T22:15:00Z"
}
}