CVE-2023-52081: Github.com/ewen lbh/ffcss Ewen-lbh/ffcss Late-Unicode Normalization Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-wpmx-564x-h2mh
CVSS 5.3
CWE-176 CWE-74
Published
Advisory Summary

CVE-2023-52081 is a MODERATE (CVSS 5.3) ewen-lbh/ffcss late-unicode normalization vulnerability vulnerability (CWE-176: Improper Handling of Unicode Encoding) affecting Github.com/ewen lbh/ffcss libraries in the Go ecosystem. The issue involves ewen-lbh/ffcss late-unicode normalization vulnerability. Remediation is available by upgrading affected packages to version 0.2.0.

CVE-2023-52081 at a Glance

CVE Identifier CVE-2023-52081
GHSA Identifier GHSA-wpmx-564x-h2mh
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-176: Improper Handling of Unicode Encoding
Affected Product Github.com/ewen lbh/ffcss
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2023-52081

To remediate this vulnerability, upgrade all affected Github.com/ewen lbh/ffcss dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/ewen-lbh/ffcss fixed: 0.2.0
Upgrade github.com/ewen-lbh/ffcss to 0.2.0
Verify Direct and Transitive Dependencies

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

inspect dependencies for github.com/ewen-lbh/ffcss

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-52081, inspect your project dependencies for Github.com/ewen lbh/ffcss:

inspect dependencies for github.com/ewen-lbh/ffcss

Analyze the terminal output to locate any version of Github.com/ewen lbh/ffcss in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-176: Improper Handling of Unicode Encoding, where the product does not properly handle when an input contains unicode encoding. In Github.com/ewen lbh/ffcss, 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

### 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 `[-_ .]`. ```go // 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](https://github.com/ewen-lbh/ffcss/blob/master/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 - https://sim4n6.beehiiv.com/p/unicode-characters-bypass-security-checks

CVE-2023-52081 Affected Github.com/ewen lbh/ffcss Versions

1 component(s)
Fixed Versions:
0.2.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/ewen-lbh/ffcss
Go
< 0.2.0
0.2.0

References

Frequently Asked Questions

What is CVE-2023-52081?
CVE-2023-52081 is a security vulnerability in Github.com/ewen lbh/ffcss involving ewen-lbh/ffcss Late-Unicode normalization vulnerability under CWE-176: Improper Handling of Unicode Encoding.
Which Github.com/ewen lbh/ffcss versions are affected?
Affected versions include releases prior to 0.2.0 across affected packages: github.com/ewen-lbh/ffcss.
What version fixes CVE-2023-52081?
Upgrading to 0.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/ewen-lbh/ffcss affected?
Yes, github.com/ewen-lbh/ffcss is affected in releases prior to 0.2.0. Upgrade your dependency to 0.2.0 or later.
What is the CVSS score of CVE-2023-52081?
CVE-2023-52081 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2023-52081?
CVE-2023-52081 is classified under CWE-176: Improper Handling of Unicode Encoding (The product does not properly handle when an input contains Unicode encoding.).
How can I check Go dependencies for CVE-2023-52081?
Run the dependency tree command: 'inspect dependencies for github.com/ewen-lbh/ffcss'. 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-wpmx-564x-h2mh",
  "modified" : "2024-03-01T14:35:42Z",
  "published" : "2023-12-28T21:16:57Z",
  "aliases" : [ "CVE-2023-52081" ],
  "summary" : "ewen-lbh/ffcss Late-Unicode normalization vulnerability",
  "details" : "### Summary\nThe 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 `[-_ .]`. \n\n```go\n// lookupPreprocess applies transformations to s so that it can be compared\n// to search for something.\n// For example, it is used by (ThemeStore).Lookup\nfunc lookupPreprocess(s string) string {\n\treturn strings.ToLower(norm.NFKD.String(regexp.MustCompile(`[-_ .]`).ReplaceAllString(s, \"\")))\n}\n``` \n\nTake 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.\n\n### Impact\n\nThe `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](https://github.com/ewen-lbh/ffcss/blob/master/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.\n\n### Remediation\n\nA simple fix would be to initially perform the Unicode normalization and then the rest of validations.\n\n### References\n\n - https://sim4n6.beehiiv.com/p/unicode-characters-bypass-security-checks\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/ewen-lbh/ffcss"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ewen-lbh/ffcss/security/advisories/GHSA-wpmx-564x-h2mh"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-52081"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ewen-lbh/ffcss/commit/f9c491874b858a32fcae15045f169fd7d02f90dc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ewen-lbh/ffcss"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-176", "CWE-74" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-12-28T21:16:57Z",
    "nvd_published_at" : "2023-12-28T16:16:02Z"
  }
}