Skip to content

fix: add SAML response XML digital signature verification to prevent … - #3

Merged
Senthil455 merged 2 commits into
Senthil455:mainfrom
DivyashreeR008:fix/saml-acs-signature-verification
Jun 14, 2026
Merged

fix: add SAML response XML digital signature verification to prevent …#3
Senthil455 merged 2 commits into
Senthil455:mainfrom
DivyashreeR008:fix/saml-acs-signature-verification

Conversation

@DivyashreeR008

Copy link
Copy Markdown
Collaborator

…auth bypass

Security Fix

The SAML ACS endpoint (POST /saml/acs) previously decoded the base64 SAMLResponse and extracted user attributes via regex without verifying the XML digital signature. This allowed anyone with a crafted SAMLResponse to impersonate any user.

Changes:

  • Added @xmldom/xmldom and xml-crypto dependencies
  • Added SAML_IDP_CERT environment variable for IdP public certificate
  • Parse SAML XML and verify ds:Signature before processing assertions
  • If SAML_IDP_CERT is configured, reject unsigned or invalid signatures
  • Signature verification uses X.509 certificate from environment config
  • Backward compatible: if SAML_IDP_CERT is empty, no verification is performed (dev mode); log a warning in this case

…auth bypass

Security Fix

The SAML ACS endpoint (POST /saml/acs) previously decoded the base64
SAMLResponse and extracted user attributes via regex without verifying
the XML digital signature. This allowed anyone with a crafted SAMLResponse
to impersonate any user.

Changes:
- Added @xmldom/xmldom and xml-crypto dependencies
- Added SAML_IDP_CERT environment variable for IdP public certificate
- Parse SAML XML and verify ds:Signature before processing assertions
- If SAML_IDP_CERT is configured, reject unsigned or invalid signatures
- Signature verification uses X.509 certificate from environment config
- Backward compatible: if SAML_IDP_CERT is empty, no verification is
  performed (dev mode); log a warning in this case
@Senthil455
Senthil455 merged commit 227a98b into Senthil455:main Jun 14, 2026
3 of 9 checks passed
DivyashreeR008 referenced this pull request in DivyashreeR008/Atlas-Workforce-System Jun 17, 2026
…fication

fix: add SAML response XML digital signature verification to prevent …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants