fix: validate JWT exp claim in Go services using ParseWithClaims - #10
Merged
Conversation
… fixes, Go/Java build fixes
…wn menu, and Lucide icons
…pdate feat: update header section UI with sticky scroll shadow, user dropdo…
Most services rely solely on X-Tenant-Id and X-User-Role HTTP headers from the client with zero verification. Any client can impersonate any tenant or role. The attendance service (Go/Fiber) has no middleware at all — all endpoints are fully public. Files: services/attendance-service/main.go:249 — No auth middleware services/payroll-java-service/.../PayrollController.java:40-41 — Client controls X-User-Role: admin services/live-service/main.py — All endpoints public services/lms-service/handlers/*.go — No auth checks Co-Authored-By: Divya shree R <divyashreer2538@gmail.com>
add: Authentication/Authorization
…frontend with leave management endpoints
… visualization charts
…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
…fication fix: add SAML response XML digital signature verification to prevent …
…d nested menu structure
… and observability configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Fixed JWT expiration validation across three Go services where
jwt.ParsewithMapClaimssilently discarded type-assertion errors and did not automatically validate theexpclaim, allowing tokens to remain valid forever.Files changed:
jwt.Parsewithjwt.ParseWithClaimsusing a typedinternalClaimsstruct embeddingjwt.RegisteredClaims. Removed silent_type-assertion discards.validateJWTandinternalAuthMiddlewarefunctions.What changed:
jwt.RegisteredClaims(enables automaticexp,nbf,iatvalidation)jwt.Parsetojwt.ParseWithClaimsfor typed claim parsingclaims["key"].(string)silent discards with typed field access!token.Validchecks (handled byParseWithClaimswithRegisteredClaims)