From 999596d99af2ae0d8c589b7bf5eb1325e565e940 Mon Sep 17 00:00:00 2001 From: "advisory-database[bot]" <45398580+advisory-database[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 15:52:20 +0000 Subject: [PATCH] Publish GHSA-qpg4-4w7w-2mq5 --- .../2020/04/GHSA-qpg4-4w7w-2mq5/GHSA-qpg4-4w7w-2mq5.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/advisories/github-reviewed/2020/04/GHSA-qpg4-4w7w-2mq5/GHSA-qpg4-4w7w-2mq5.json b/advisories/github-reviewed/2020/04/GHSA-qpg4-4w7w-2mq5/GHSA-qpg4-4w7w-2mq5.json index fa1d90233ce..95b343837fe 100644 --- a/advisories/github-reviewed/2020/04/GHSA-qpg4-4w7w-2mq5/GHSA-qpg4-4w7w-2mq5.json +++ b/advisories/github-reviewed/2020/04/GHSA-qpg4-4w7w-2mq5/GHSA-qpg4-4w7w-2mq5.json @@ -1,13 +1,13 @@ { "schema_version": "1.4.0", "id": "GHSA-qpg4-4w7w-2mq5", - "modified": "2021-01-08T20:21:04Z", + "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\nbypass exists in [Faye][1]'s extension system. This vulnerability has existed in\nthe Node.js and Ruby versions of the server since version 0.5.0, when extensions\nwere first introduced, in July 2010. It is patched in versions 1.0.4, 1.1.3 and\n1.2.5, which we are releasing today.\n\nThe vulnerability allows any client to bypass checks put in place by server-side\nextensions, by appending extra segments to the message channel. For example, the\nFaye [extension docs][2] suggest that users implement access control for\nsubscriptions by checking incoming messages for the `/meta/subscribe` channel,\nfor 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\ntrigger connection and subscription events, means that a client can bypass this\ncheck 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\nmessage's channel is exactly equal to `/meta/subscribe`. But it will still be\nprocessed as a subscription request by the server, so the client becomes\nsubscribed to the channel `/foo` without supplying the necessary credentials.\n\nThe vulnerability is caused by the way the Faye server recognises meta channels.\nIt will treat a message to any channel that's a prefix-match for one of the\nspecial channels `/meta/handshake`, `/meta/connect`, `/meta/subscribe`,\n`/meta/unsubscribe` or `/meta/disconnect`, as though it were an exact match for\nthat channel. So, a message to `/meta/subscribe/x` is still processed as a\nsubscription request, for example.\n\nAn authentication bypass for subscription requests is the most serious effect of\nthis 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.\nThese should be drop-in replacements for prior versions and you should upgrade\nimmediately if you are running any prior version.\n\nIf you are unable to install one of these versions, you can make your extensions\ncatch all messages the server would process by checking the channel _begins_\nwith 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", + "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", @@ -86,6 +86,10 @@ "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"