Junglewise Threat Intelligence

CVE-2023-40178: node-saml/node-saml timestamp validation bypass in validatePostRequestAsync

CVE-2023-40178 · Severity: low · CVSS 3.1 · Published 2023-08-21

Technologies: @node-saml/node-saml (npm), Node-Saml. Vendors: npm.

Executive brief

node-saml is a Node.js library that implements SAML authentication for web applications, handling login and logout flows. A flaw in the validatePostRequestAsync function fails to verify that logout requests have not expired, allowing an attacker to replay old logout requests indefinitely. This could force legitimate users to be logged out even after the original request has expired, particularly at scale when logout requests are sent to multiple applications simultaneously.

Technical details

The vulnerability is a timestamp validation bypass (CWE-347) in the validatePostRequestAsync() function within saml.js. The library checks the IssueInstance and NotOnOrAfter fields but omits the checkTimestampsValidityError validation, which compares the current time against the request's expiration time. An attacker with a valid LogoutRequest XML (possessing valid signature and certificate) can replay it multiple times regardless of whether the current timestamp exceeds the NotOnOrAfter value. The flaw requires the attacker to have obtained a valid LogoutRequest but allows unlimited replay without time-based restrictions. The vulnerability was patched in version 4.0.5.

Affected products

  • node-saml node-saml <4.0.5

Timeline

  • 2023-08-21: disclosed
  • 2023-08-21: patched: version 4.0.5 released

References

Related threats