Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS13cG14LTU2NHgtaDJtaM4AA4D8
ewen-lbh/ffcss Late-Unicode normalization vulnerability
Summary
The function lookupPreprocess()
is meant to apply some transformations to a string by disabling characters in the regex [-_ .]
. However, due to the use of late Unicode normalization of type NFKD, it is possible to bypass that validation and re-introduce all the characters in the regex [-_ .]
.
// lookupPreprocess applies transformations to s so that it can be compared
// to search for something.
// For example, it is used by (ThemeStore).Lookup
func lookupPreprocess(s string) string {
return strings.ToLower(norm.NFKD.String(regexp.MustCompile(`[-_ .]`).ReplaceAllString(s, "")))
}
Take the following equivalent Unicode character U+2024 (․). Initially, the lookupPreprocess()
function would compile the regex and replace the regular dot (.). However, the U+2024 (․) would bypass the ReplaceAllString()
. When the normalization operation is applied to U+2024 (․), the resulting character will be U+002E (.). Thus, the dot was reintroduced back.
Impact
The lookupPreprocess()
can be easily bypassed with equivalent Unicode characters like U+FE4D (﹍), which would result in the omitted U+005F (_), for instance. It should be noted here that the variable s
is user-controlled data coming from /cmd/ffcss/commands.go#L22-L28 the command args. The lookupPreprocess()
function is only ever used to search for themes loosely (case insensitively, while ignoring dashes, underscores and dots), so the actual security impact is classified as low.
Remediation
A simple fix would be to initially perform the Unicode normalization and then the rest of validations.
References Permalink: https://github.com/advisories/GHSA-wpmx-564x-h2mh
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS13cG14LTU2NHgtaDJtaM4AA4D8
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 11 months ago
Updated: 9 months ago
CVSS Score: 5.3
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Identifiers: GHSA-wpmx-564x-h2mh, CVE-2023-52081
References:
- https://github.com/ewen-lbh/ffcss/security/advisories/GHSA-wpmx-564x-h2mh
- https://nvd.nist.gov/vuln/detail/CVE-2023-52081
- https://github.com/ewen-lbh/ffcss/commit/f9c491874b858a32fcae15045f169fd7d02f90dc
- https://github.com/advisories/GHSA-wpmx-564x-h2mh
Blast Radius: 1.0
Affected Packages
go:github.com/ewen-lbh/ffcss
Dependent packages: 0Dependent repositories: 0
Downloads:
Affected Version Ranges: < 0.2.0
Fixed in: 0.2.0
All affected versions: 0.1.0, 0.1.1, 0.1.2
All unaffected versions: 0.2.0