Description
In oauth2-server (aka node-oauth2-server) through 3.1.1, the value of the redirect_uri parameter received during the authorization and token request is checked against an incorrect URI pattern ("[a-zA-Z][a-zA-Z0-9+.-]+:") before making a redirection. This allows a malicious client to pass an XSS payload through the redirect_uri parameter while making an authorization request. NOTE: this vulnerability is similar to CVE-2020-7741.
Remediation
References
https://github.com/oauthjs/node-oauth2-server/blob/91d2cbe70a0eddc53d72def96864e2de0fd41703/lib/grant-types/authorization-code-grant-type.js#L143
https://github.com/oauthjs/node-oauth2-server/blob/91d2cbe70a0eddc53d72def96864e2de0fd41703/lib/validator/is.js#L12
https://github.com/oauthjs/node-oauth2-server/issues/637
https://tools.ietf.org/html/rfc3986#section-3
https://tools.ietf.org/html/rfc6749#section-3.1.2
Related Vulnerabilities
CVE-2018-3719 Vulnerability in npm package mixin-deep
CVE-2021-41571 Vulnerability in maven package org.apache.pulsar:pulsar
CVE-2020-7642 Vulnerability in npm package lazysizes
CVE-2013-6397 Vulnerability in maven package org.apache.solr:solr-velocity
CVE-2023-30529 Vulnerability in maven package org.jenkins-ci.plugins:lucene-search