CVE-2022-1996: Github.com/emicklei/go restful/v3 Authorization Bypass Through User-Controlled Key Vulnerability

CRITICAL
Advisory Identifier: GHSA-r48q-9g5r-8q2h
CVSS 9.1
CWE-639
Published
Advisory Summary

CVE-2022-1996 is a CRITICAL (CVSS 9.1) authorization bypass through user-controlled key vulnerability (CWE-639: Authorization Bypass Through User-Controlled Key) affecting Github.com/emicklei/go restful/v3 libraries in the Go ecosystem. The issue involves authorization bypass through user-controlled key in go-restful. Remediation is available by upgrading affected packages to version 3.8.0, 2.16.0.

CVE-2022-1996 at a Glance

CVE Identifier CVE-2022-1996
GHSA Identifier GHSA-r48q-9g5r-8q2h
Severity CRITICAL
CVSS v3.1 Base Score 9.1
CWE Classification CWE-639: Authorization Bypass Through User-Controlled Key
Affected Product Github.com/emicklei/go restful/v3
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.1

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:H/I:H/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 High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2022-1996

To remediate this vulnerability, upgrade all affected Github.com/emicklei/go restful/v3 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/emicklei/go-restful/v3 fixed: 3.8.0
Upgrade github.com/emicklei/go-restful/v3 to 3.8.0
github.com/emicklei/go-restful fixed: 2.16.0
Upgrade github.com/emicklei/go-restful to 2.16.0
github.com/emicklei/go-restful/v2 fixed: Latest secure release
Upgrade github.com/emicklei/go-restful/v2 to Latest secure release
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/emicklei/go-restful/v3

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-1996, inspect your project dependencies for Github.com/emicklei/go restful/v3:

inspect dependencies for github.com/emicklei/go-restful/v3

Analyze the terminal output to locate any version of Github.com/emicklei/go restful/v3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.8.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-639: Authorization Bypass Through User-Controlled Key, where the system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. In Github.com/emicklei/go restful/v3, 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

Authorization Bypass Through User-Controlled Key in GitHub repository emicklei/go-restful prior to v3.8.0.

CVE-2022-1996 Affected Github.com/emicklei/go restful/v3 Versions

3 component(s)
Fixed Versions:
3.8.02.16.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/emicklei/go-restful/v3
Go
≥ 3.0.0
< 3.8.0
3.8.0
github.com/emicklei/go-restful
Go
< 2.16.0
2.16.0
github.com/emicklei/go-restful/v2
Go
≤ 2.7.1

References

NVD — CVE-2022-1996 NVD
https://nvd.nist.gov/vuln/detail/CVE-2022-1996
Github.com/emicklei/go restful/v3 Source Repository REPOSITORY
https://github.com/emicklei/go-restful/issues/489
Security Fix Commit FIX COMMIT
https://github.com/emicklei/go-restful/commit/926662532deb450272956c7bc573978464aae74e
Security Fix Commit FIX COMMIT
https://github.com/emicklei/go-restful/commit/f292efff46ae17e9d104f865a60a39a2ae9402f1
Security Fix Commit FIX COMMIT
https://github.com/emicklei/go-restful/commit/fd3c327a379ce08c68ef18765bdc925f5d9bad10
Github.com/emicklei/go restful/v3 Security Information SECURITY
https://security.netapp.com/advisory/ntap-20220923-0005
pkg.go.dev/vuln/go-2022-0619 WEB
https://pkg.go.dev/vuln/GO-2022-0619
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZY2SLWOQR4ZURQ7UBRZ7JIX6H6F5JHJR
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZGQKWD6SE75PFBPFVSZYAKAVXKBZXKWS
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/Z55VUVGO7E5PJFXIOVAY373NZRHBNCI5
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/W56PP46JVZEKCANBKXFKRVSBBRRMCY6V
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SO5QC2JFW2PXBWAE27OYYYL5SPFUBHTY
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RQXU752ALW53OJAF5MG3WMR5CCZVLWW6
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OBDD3Q23RCGAGHIXUCWBU6N3S4RNAKXB
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/575BLJ3Y2EQBRNTFR2OSQQ6L2W6UCST3
huntr.dev/bounties/be837427-4... WEB
https://huntr.dev/bounties/be837427-415c-4d8c-808b-62ce20aa84f1
Github.com/emicklei/go restful/v3 Source Repository REPOSITORY
https://github.com/emicklei/go-restful

Frequently Asked Questions

What is CVE-2022-1996?
CVE-2022-1996 is a security vulnerability in Github.com/emicklei/go restful/v3 involving Authorization Bypass Through User-Controlled Key in go-restful under CWE-639: Authorization Bypass Through User-Controlled Key.
Which Github.com/emicklei/go restful/v3 versions are affected?
Affected versions include releases prior to 3.8.0, 2.16.0 across affected packages: github.com/emicklei/go-restful/v3, github.com/emicklei/go-restful, github.com/emicklei/go-restful/v2.
What version fixes CVE-2022-1996?
Upgrading to 3.8.0, 2.16.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/emicklei/go-restful/v3 affected?
Yes, github.com/emicklei/go-restful/v3 is affected in releases prior to 3.8.0. Upgrade your dependency to 3.8.0 or later.
Is github.com/emicklei/go-restful affected?
Yes, github.com/emicklei/go-restful is affected in releases prior to 2.16.0. Upgrade your dependency to 2.16.0 or later.
What is the CVSS score of CVE-2022-1996?
CVE-2022-1996 has a CVSS v3.1 base score of 9.1 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2022-1996?
CVE-2022-1996 is classified under CWE-639: Authorization Bypass Through User-Controlled Key (The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.).
How can I check Go dependencies for CVE-2022-1996?
Run the dependency tree command: 'inspect dependencies for github.com/emicklei/go-restful/v3'. 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-r48q-9g5r-8q2h",
  "modified" : "2022-06-17T18:18:04Z",
  "published" : "2022-06-09T00:00:23Z",
  "aliases" : [ "CVE-2022-1996" ],
  "summary" : "Authorization Bypass Through User-Controlled Key in go-restful",
  "details" : "Authorization Bypass Through User-Controlled Key in GitHub repository emicklei/go-restful prior to v3.8.0.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/emicklei/go-restful/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.8.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/emicklei/go-restful"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.16.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/emicklei/go-restful/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.7.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-1996"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/emicklei/go-restful/issues/489"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/emicklei/go-restful/commit/926662532deb450272956c7bc573978464aae74e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/emicklei/go-restful/commit/f292efff46ae17e9d104f865a60a39a2ae9402f1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/emicklei/go-restful/commit/fd3c327a379ce08c68ef18765bdc925f5d9bad10"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20220923-0005"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-0619"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZY2SLWOQR4ZURQ7UBRZ7JIX6H6F5JHJR"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZGQKWD6SE75PFBPFVSZYAKAVXKBZXKWS"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/Z55VUVGO7E5PJFXIOVAY373NZRHBNCI5"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/W56PP46JVZEKCANBKXFKRVSBBRRMCY6V"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SO5QC2JFW2PXBWAE27OYYYL5SPFUBHTY"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RQXU752ALW53OJAF5MG3WMR5CCZVLWW6"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OBDD3Q23RCGAGHIXUCWBU6N3S4RNAKXB"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/575BLJ3Y2EQBRNTFR2OSQQ6L2W6UCST3"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/be837427-415c-4d8c-808b-62ce20aa84f1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/emicklei/go-restful"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-639" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-09T23:50:21Z",
    "nvd_published_at" : "2022-06-08T13:15:00Z"
  }
}