CVE-2020-11020: Faye Authentication And Extension Bypass Vulnerability

HIGH
Advisory Identifier: GHSA-qpg4-4w7w-2mq5
CVSS 8.5
CWE-287
Published
Advisory Summary

CVE-2020-11020 is a HIGH (CVSS 8.5) authentication and extension bypass vulnerability (CWE-287: Improper Authentication) affecting Faye libraries in the RubyGems ecosystem. The issue involves authentication and extension bypass in faye. Remediation is available by upgrading affected packages to version 1.0.4, 1.1.3, 1.2.5.

CVE-2020-11020 at a Glance

CVE Identifier CVE-2020-11020
GHSA Identifier GHSA-qpg4-4w7w-2mq5
Severity HIGH
CVSS v3.1 Base Score 8.5
CWE Classification CWE-287: Improper Authentication
Affected Product Faye
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 8.5

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

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

How to Fix CVE-2020-11020

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

faye fixed: 1.0.4
Upgrade faye to 1.0.4
faye fixed: 1.1.3
Upgrade faye to 1.1.3
faye fixed: 1.2.5
Upgrade faye to 1.2.5
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 faye

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-11020, inspect your project dependencies for Faye:

inspect dependencies for faye

Analyze the terminal output to locate any version of Faye in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.4), 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-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Faye, 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

On 20 April 2020 it was reported to me that the potential for authentication bypass exists in [Faye][1]'s extension system. This vulnerability has existed in the Node.js and Ruby versions of the server since version 0.5.0, when extensions were first introduced, in July 2010. It is patched in versions 1.0.4, 1.1.3 and 1.2.5, which we are releasing today. The vulnerability allows any client to bypass checks put in place by server-side extensions, by appending extra segments to the message channel. For example, the Faye [extension docs][2] suggest that users implement access control for subscriptions by checking incoming messages for the `/meta/subscribe` channel, for example: ```js server.addExtension({ incoming: function(message, callback) { if (message.channel === '/meta/subscribe') { if (message.ext.authToken !== 'my super secret password') { message.error = 'Invalid auth token'; } } callback(message); } }); ``` A bug in the server's code for recognising the special `/meta/*` channels, which trigger connection and subscription events, means that a client can bypass this check by sending a message to `/meta/subscribe/x` rather than `/meta/subscribe`: ```json { "channel": "/meta/subscribe/x", "clientId": "3jrc6602npj4gyp6bn5ap2wqzjtb2q3", "subscription": "/foo" } ``` This message will not be checked by the above extension, as it checks the message's channel is exactly equal to `/meta/subscribe`. But it will still be processed as a subscription request by the server, so the client becomes subscribed to the channel `/foo` without supplying the necessary credentials. The vulnerability is caused by the way the Faye server recognises meta channels. It will treat a message to any channel that's a prefix-match for one of the special channels `/meta/handshake`, `/meta/connect`, `/meta/subscribe`, `/meta/unsubscribe` or `/meta/disconnect`, as though it were an exact match for that channel. So, a message to `/meta/subscribe/x` is still processed as a subscription request, for example. An authentication bypass for subscription requests is the most serious effect of this but all other meta channels are susceptible to similar manipulation. This parsing bug in the server is fixed in versions 1.0.4, 1.1.3 and 1.2.5. These should be drop-in replacements for prior versions and you should upgrade immediately if you are running any prior version. If you are unable to install one of these versions, you can make your extensions catch all messages the server would process by checking the channel _begins_ with the expected channel name, for example: ```js server.addExtension({ incoming: function(message, callback) { if (message.channel.startsWith('/meta/subscribe')) { // authentication logic } callback(message); } }); ``` [1]: https://faye.jcoglan.com/ [2]: https://faye.jcoglan.com/node/extensions.html

CVE-2020-11020 Affected Faye Versions

3 component(s)
Fixed Versions:
1.0.41.1.31.2.5
Product / Package Ecosystem Affected Versions Fixed Version
faye
RubyGems
≥ 0.5.0
< 1.0.4
1.0.4
faye
RubyGems
≥ 1.1.0
< 1.1.3
1.1.3
faye
RubyGems
≥ 1.2.0
< 1.2.5
1.2.5

References

Frequently Asked Questions

What is CVE-2020-11020?
CVE-2020-11020 is a security vulnerability in Faye involving Authentication and extension bypass in Faye under CWE-287: Improper Authentication.
Which Faye versions are affected?
Affected versions include releases prior to 1.0.4, 1.1.3, 1.2.5 across affected packages: faye.
What version fixes CVE-2020-11020?
Upgrading to 1.0.4, 1.1.3, 1.2.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is faye affected?
Yes, faye is affected in releases prior to 1.0.4, 1.1.3, 1.2.5. Upgrade your dependency to 1.0.4, 1.1.3, 1.2.5 or later.
What is the CVSS score of CVE-2020-11020?
CVE-2020-11020 has a CVSS v3.1 base score of 8.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N.
What CWE is associated with CVE-2020-11020?
CVE-2020-11020 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check RubyGems dependencies for CVE-2020-11020?
Run the dependency tree command: 'inspect dependencies for faye'. 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-qpg4-4w7w-2mq5",
  "modified" : "2023-05-16T15:51:44Z",
  "published" : "2020-04-29T17:41:15Z",
  "aliases" : [ "CVE-2020-11020" ],
  "summary" : "Authentication and extension bypass in Faye",
  "details" : "On 20 April 2020 it was reported to me that the potential for authentication bypass exists in [Faye][1]'s extension system. This vulnerability has existed in the Node.js and Ruby versions of the server since version 0.5.0, when extensions were first introduced, in July 2010. It is patched in versions 1.0.4, 1.1.3 and 1.2.5, which we are releasing today.\n\nThe vulnerability allows any client to bypass checks put in place by server-side extensions, by appending extra segments to the message channel. For example, the Faye [extension docs][2] suggest that users implement access control for subscriptions by checking incoming messages for the `/meta/subscribe` channel, for example:\n\n```js\nserver.addExtension({\n  incoming: function(message, callback) {\n    if (message.channel === '/meta/subscribe') {\n      if (message.ext.authToken !== 'my super secret password') {\n        message.error = 'Invalid auth token';\n      }\n    }\n    callback(message);\n  }\n});\n```\n\nA bug in the server's code for recognising the special `/meta/*` channels, which trigger connection and subscription events, means that a client can bypass this check by sending a message to `/meta/subscribe/x` rather than `/meta/subscribe`:\n\n```json\n{\n  \"channel\": \"/meta/subscribe/x\",\n  \"clientId\": \"3jrc6602npj4gyp6bn5ap2wqzjtb2q3\",\n  \"subscription\": \"/foo\"\n}\n```\n\nThis message will not be checked by the above extension, as it checks the message's channel is exactly equal to `/meta/subscribe`. But it will still be processed as a subscription request by the server, so the client becomes subscribed to the channel `/foo` without supplying the necessary credentials.\n\nThe vulnerability is caused by the way the Faye server recognises meta channels. It will treat a message to any channel that's a prefix-match for one of the special channels `/meta/handshake`, `/meta/connect`, `/meta/subscribe`, `/meta/unsubscribe` or `/meta/disconnect`, as though it were an exact match for that channel. So, a message to `/meta/subscribe/x` is still processed as a subscription request, for example.\n\nAn authentication bypass for subscription requests is the most serious effect of this but all other meta channels are susceptible to similar manipulation.\n\nThis parsing bug in the server is fixed in versions 1.0.4, 1.1.3 and 1.2.5. These should be drop-in replacements for prior versions and you should upgrade immediately if you are running any prior version.\n\nIf you are unable to install one of these versions, you can make your extensions catch all messages the server would process by checking the channel _begins_ with the expected channel name, for example:\n\n```js\nserver.addExtension({\n  incoming: function(message, callback) {\n    if (message.channel.startsWith('/meta/subscribe')) {\n      // authentication logic\n    }\n    callback(message);\n  }\n});\n```\n\n[1]: https://faye.jcoglan.com/\n[2]: https://faye.jcoglan.com/node/extensions.html",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "faye"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.5.0"
      }, {
        "fixed" : "1.0.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "faye"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.1.0"
      }, {
        "fixed" : "1.1.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "faye"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.0"
      }, {
        "fixed" : "1.2.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/faye/faye/security/advisories/GHSA-qpg4-4w7w-2mq5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-11020"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/faye/faye/commit/65d297d341b607f3cb0b5fa6021a625a991cc30e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/faye/faye"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/faye/CVE-2020-11020.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-04-29T17:40:59Z",
    "nvd_published_at" : null
  }
}