Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS0zZnZnLTR2Mm0tOThqZs4AAs_P
JWS and JWT signature validation vulnerability with special characters
Impact
Jsrsasign supports JWS(JSON Web Signatures) and JWT(JSON Web Token) validation. However JWS or JWT signature with non Base64URL encoding special characters or number escaped characters may be validated as valid by mistake.
For example, even if a string of non Base64URL encoding characters such as !@$%
or \11
is inserted into a valid JWS or JWT signature value string, it will still be a valid JWS or JWT signature by mistake.
When jsrsasign's JWS or JWT validation is used in OpenID connect or OAuth2, this vulnerability will affect to authentication or authorization.
By our internal assessment, CVSS 3.1 score will be 8.6.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
Patches
Users validate JWS or JWT signatures should upgrade to 10.5.25.
Workarounds
Validate JWS or JWT signature if it has Base64URL and dot safe string before
executing JWS.verify() or JWS.verifyJWT() method.
ACKNOWLEDGEMENT
Thanks to Adi Malyanker and Or David for this vulnerability report. Also thanks for Snyk security team for this coordination.
References
https://github.com/kjur/jsrsasign/releases/tag/10.5.25
https://github.com/kjur/jsrsasign/security/advisories/GHSA-3fvg-4v2m-98jf kjur's advisories
https://github.com/advisories/GHSA-3fvg-4v2m-98jf github advisories
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-25898
https://kjur.github.io/jsrsasign/api/symbols/KJUR.jws.JWS.html#.verifyJWT
https://kjur.github.io/jsrsasign/api/symbols/KJUR.jws.JWS.html#.verify
https://kjur.github.io/jsrsasign/api/symbols/global__.html#.isBase64URLDot
https://github.com/kjur/jsrsasign/wiki/Tutorial-for-JWS-verification
https://github.com/kjur/jsrsasign/wiki/Tutorial-for-JWT-verification
https://security.snyk.io/vuln/SNYK-JS-JSRSASIGN-2869122
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS0zZnZnLTR2Mm0tOThqZs4AAs_P
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: about 2 years ago
Updated: over 1 year ago
CVSS Score: 8.6
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
Identifiers: GHSA-3fvg-4v2m-98jf, CVE-2022-25898
References:
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-25898
- https://github.com/kjur/jsrsasign/releases/tag/10.5.25
- https://nvd.nist.gov/vuln/detail/CVE-2022-25898
- https://github.com/kjur/jsrsasign/commit/4536a6e9e8bcf1a644ab7c07ed96e453347dae41
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWER-2935898
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWERGITHUBKJUR-2935897
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2935896
- https://snyk.io/vuln/SNYK-JS-JSRSASIGN-2869122
- https://github.com/advisories/GHSA-3fvg-4v2m-98jf
Blast Radius: 33.6
Affected Packages
npm:jsrsasign
Dependent packages: 731Dependent repositories: 8,042
Downloads: 1,818,001 last month
Affected Version Ranges: >= 4.8.0, < 10.5.25
Fixed in: 10.5.25
All affected versions: 4.8.2, 4.8.3, 4.8.4, 4.8.5, 4.8.6, 4.9.0, 4.9.1, 4.9.2, 5.0.0, 5.0.1, 5.0.2, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 5.0.9, 5.0.10, 5.0.11, 5.0.12, 5.0.13, 5.0.14, 5.0.15, 5.1.0, 6.0.0, 6.0.1, 6.1.0, 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.2.0, 6.2.1, 6.2.2, 6.2.3, 7.0.0, 7.1.0, 7.1.1, 7.1.2, 7.1.3, 7.1.5, 7.2.0, 7.2.1, 7.2.2, 8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.5, 8.0.6, 8.0.7, 8.0.8, 8.0.9, 8.0.10, 8.0.11, 8.0.12, 8.0.13, 8.0.14, 8.0.15, 8.0.16, 8.0.17, 8.0.18, 8.0.19, 8.0.20, 8.0.21, 8.0.22, 8.0.23, 8.0.24, 9.0.0, 9.0.1, 9.0.2, 9.0.3, 9.1.0, 9.1.1, 9.1.2, 9.1.3, 9.1.4, 9.1.5, 9.1.6, 9.1.7, 9.1.8, 9.1.9, 10.0.0, 10.0.1, 10.0.2, 10.0.3, 10.0.4, 10.0.5, 10.1.0, 10.1.1, 10.1.2, 10.1.3, 10.1.4, 10.1.5, 10.1.6, 10.1.7, 10.1.8, 10.1.9, 10.1.10, 10.1.11, 10.1.12, 10.1.13, 10.2.0, 10.3.0, 10.3.2, 10.4.0, 10.4.1, 10.5.0, 10.5.1, 10.5.2, 10.5.3, 10.5.4, 10.5.5, 10.5.6, 10.5.7, 10.5.8, 10.5.9, 10.5.10, 10.5.11, 10.5.12, 10.5.13, 10.5.14, 10.5.15, 10.5.16, 10.5.17, 10.5.18, 10.5.19, 10.5.20, 10.5.21, 10.5.22, 10.5.23, 10.5.24
All unaffected versions: 0.0.1, 0.0.2, 0.0.3, 10.5.25, 10.5.26, 10.5.27, 10.6.0, 10.6.1, 10.7.0, 10.8.0, 10.8.1, 10.8.2, 10.8.3, 10.8.4, 10.8.5, 10.8.6, 10.9.0, 11.0.0, 11.1.0