Skip to content

fix: use constant-time comparison for auth credentials (CWE-208)#2864

Open
spidershield-contrib wants to merge 1 commit intoteableio:developfrom
spidershield-contrib:fix/cwe-208-timing-safe-comparison
Open

fix: use constant-time comparison for auth credentials (CWE-208)#2864
spidershield-contrib wants to merge 1 commit intoteableio:developfrom
spidershield-contrib:fix/cwe-208-timing-safe-comparison

Conversation

@spidershield-contrib
Copy link
Copy Markdown

Summary

Fixes #2863 — replaces timing-vulnerable comparison with constant-time alternative.

Changes

  • local-auth.service.ts: Replace === hash comparison with crypto.timingSafeEqual() in comparePassword()
  • permission.service.ts: Replace === share password comparison with crypto.timingSafeEqual()
  • No behavioral change for valid authentication flows
  • Uses stdlib only — no new dependencies

CWE Reference

  • CWE-208: Observable Timing Discrepancy

Found by SpiderShield security scanner

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

Security: timing attack in auth comparison (CWE-208)

2 participants