Lucene search

K
osvGoogleOSV:GHSA-RV3X-XQ3R-8J9H
HistoryJun 09, 2023 - 7:32 p.m.

LeafKit allows XSS with untrusted user input

2023-06-0919:32:32
Google
osv.dev
2
xss
unsanitised data
variable tags
content security policy
patched
sanitise input
csp
github
vapor

4.3 Medium

CVSS2

Attack Vector

NETWORK

Attack Complexity

MEDIUM

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

PARTIAL

Availability Impact

NONE

AV:N/AC:M/Au:N/C:N/I:P/A:N

7.4 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

REQUIRED

Scope

CHANGED

Confidentiality Impact

HIGH

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N

0.001 Low

EPSS

Percentile

36.3%

Impact

This affects anyone passing unsanitised data to Leaf’s variable tags. Before this fix, Leaf would not escape any strings passed to tags as variables. If an attacker managed to find a variable that was rendered with their unsanitised data, they could inject scripts into a generated Leaf page, which could enable XSS attacks if other mitigations such as a Content Security Policy were not enabled.

Patches

This has been patched in 1.3.0

Workarounds

Sanitise any untrusted input before passing it to Leaf and enable a CSP to block inline script and CSS data.

References

https://github.com/vapor/leaf-kit-ghsa-rv3x-xq3r-8j9h/pull/1

For more information

If you have any questions or comments about this advisory:

CPENameOperatorVersion
github.com/vapor/leaf-kitlt1.3.0

4.3 Medium

CVSS2

Attack Vector

NETWORK

Attack Complexity

MEDIUM

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

PARTIAL

Availability Impact

NONE

AV:N/AC:M/Au:N/C:N/I:P/A:N

7.4 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

REQUIRED

Scope

CHANGED

Confidentiality Impact

HIGH

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N

0.001 Low

EPSS

Percentile

36.3%

Related for OSV:GHSA-RV3X-XQ3R-8J9H