Application security remediation¶
Date: 2026-10-25. Scope: the four application-level remediation areas approved after the auth/BFF audit. LDAP transport, ingress/network configuration and public metrics exposure are deferred. Existing unrelated working-tree changes were preserved.
Implemented behavior¶
| Finding | Change |
|---|---|
| AUTH-BFF-01 | 34 state-changing GET routes now require POST. Cookie-mode POST already requires the session CSRF header. Converted List Management updates explicitly require authentication before the public reference-data matcher. |
| AUTH-BFF-03 | BFF counters use the servlet peer address and ignore raw X-Forwarded-For. |
| AUTH-BFF-04 | A pre-authentication servlet filter limits direct auth login, authorization initiation, token and revocation traffic. Defaults: 120 requests per peer per minute; 20 credential submissions per normalized account per minute. Redis failure returns 503. |
| AUTH-BFF-05 | Missing/wrong/locked credentials receive generic auth and BFF responses without retry counters or lock metadata. Locked accounts perform password work instead of an immediate fast-path failure. Verified-credential LDAP onboarding and first-login/password-expiry actions remain supported. |
| AUTH-BFF-06 | Logout atomically queues remote revocation, blacklists the current JTI and removes the local session/refresh lease in Redis. Remote failures return 503/REVOCATION_PENDING while cookies are cleared. A worker retries every five seconds and removes work only after success. |
| AUTH-BFF-07 | Browser authentication records a Redis-backed per-user generation. Token logout, replay-family revocation and administrative revoke-user invalidate stale browser SSO. Affected browsers must authenticate again. |
| AUTH-BFF-08 | Audit publication strips reusable session IDs and sensitive detail fields before dispatch. Refresh/deserialization logs omit session credentials. |
Client contract changes¶
These routes keep their path/parameters but change GET -> POST. Cookie callers must send the existing session CSRF header (COOKIE_CSRF_HEADER_NAME, normally X-XSRF-TOKEN). No mutating GET alias is retained. Some former GET paths may match an existing numeric-ID reader and return 400 instead of 405; tests verify rejection before any service interaction. Callers outside this repository have not been changed.
| Endpoint | Method |
|---|---|
/api/v1/archive/checkoutHRADraft |
POST |
/api/v1/archive/checkoutPSDTDraft |
POST |
/api/v1/cart/empty |
POST |
/api/v1/cart/removeCartItem |
POST |
/api/v1/dispatch/sendDispatchEmail/{workflowId} |
POST |
/api/v1/dispatch/uploadDispatchDocsToFtp |
POST |
/api/v1/list-master/update |
POST |
/api/v1/list-master/updateDefault |
POST |
/api/v1/lodgement/addLdgStepRequestForSectionalTitle |
POST |
/api/v1/lodgement/addStepsByReservationRef |
POST |
/api/v1/lodgement/checkoutLodgementDraft |
POST |
/api/v1/lodgement/processInvoice |
POST |
/api/v1/lodgement/updateDoc |
POST |
/api/v1/maintenance/processCRE |
POST |
/api/v1/maintenance/processInvoice |
POST |
/api/v1/office-timings/update |
POST |
/api/v1/prepackage/execute/all |
POST |
/api/v1/prepackage/execute/change |
POST |
/api/v1/prepackage/subscription/status |
POST |
/api/v1/relodgement/deleteStep |
POST |
/api/v1/reservation/addDraftToTransfer |
POST |
/api/v1/reservation/addOtherDataByGis |
POST |
/api/v1/reservation/checkoutDraft |
POST |
/api/v1/reservation/processStep |
POST |
/api/v1/reservation/updateNumberingStatus |
POST |
/api/v1/sms |
POST |
/api/v1/user/changeStatus |
POST |
/api/v1/user/delegations/update |
POST |
/api/v1/user/passAgeExpiredScheduler |
POST |
/api/v1/user/resetForgotPassword/{email} |
POST |
/api/v1/user/verifySecurityAnswers |
POST |
/api/v1/workflow/deleteDocs |
POST |
/api/v1/workflow/productivity |
POST |
/api/v1/workflow/taskReminder |
POST |
Additional behavior:
- Generic credential errors replace account-existence/lock distinctions. Directory registration onboarding and password actions after credential verification retain their dedicated responses.
- A failed remote logout returns 503/REVOCATION_PENDING with cleared cookies and retained retry work. If Redis is unavailable, termination cannot be confirmed and the request fails. Successful atomic queueing also prevents a concurrent refresh commit from recreating the deleted session.
- Logout invalidates the user's auth-browser SSO generation; other already-issued BFF sessions retain independent lifetimes unless revoke-user is used. Users with valid credentials may sign in again. Legacy browser sessions without a generation must sign in again. No schema migration is needed.
- Override direct auth defaults with
cis.auth.request-limits.peer-requests-per-minuteandcis.auth.request-limits.account-requests-per-minute. Proxied users may share the peer budget; trusted peer normalization is a separate configuration decision. - Pending revocation work retains token material inside the Redis security boundary already used for sessions until remote success. Polling uses bounded batches; idempotent delivery permits retries across nodes. Redis durability remains a dependency.
Edge-case review¶
Checks cover spoofed forwarded headers, direct login/token/revoke exhaustion, Redis failure, generic credential response equivalence, first-login compatibility, missing CSRF, rejected GET requests, logout HTTP failure and retry, stale/missing browser generations and in-flight refresh lease cancellation. Real Redis/Oracle checks may be skipped when Docker is unavailable. This does not constitute a complete cis-api authorization or password-recovery audit.
The original audit evidence remains a pre-remediation snapshot. Current validation follows below.
Verification results¶
The final combined Gradle command completed successfully. Test results:
| Module | Reported | Passed | Skipped | Failures/errors |
|---|---|---|---|---|
| cis-auth | 95 | 87 | 8 | 0 |
| cis-bff | 112 | 109 | 3 | 0 |
| cis-api | 204 | 204 | 0 | 0 |
The auth and BFF suites were run in full, with the isolated audit regressions included. The API run selected the mutation-boundary, relodgement HTTP method, resource-server token security, reservation, lodgement, user and delegation controller tests. Oracle migration/transaction and real Redis integration tests were skipped where Docker was unavailable; this includes the new atomic logout/outbox integration test. Passing mock-based tests do not prove live Redis atomicity, Oracle replay-family behavior or an end-to-end cross-origin browser flow.
The API test run also revealed legacy user/delegation fixtures using SpringExtension without initializing Mockito mocks. Those fixtures now use MockitoExtension, and two unrelated stubs in the affected user fixture were corrected to target the methods actually exercised. Compiler warnings about deprecated APIs, unchecked test operations and MapStruct processor options remain; compilation and the selected checks pass.
./gradlew.bat -I scripts/security-audit/audit.init.gradle :cis-auth:test :cis-bff:test :cis-api:test --tests '*MutatingGetBoundaryTest' --tests '*RelodgementHttpMethodTest' --tests '*ResourceServerTokenSecurityTest' --tests '*ReservationResourceTest' --tests '*LodgementResourceTest' --tests '*UserResourceTest' --tests '*UserDelegationsResourceTest' --console=plain
The --tests filters apply to the API test task; auth/BFF run their full suites. git diff --check passed for the changed source and documentation. Current source fingerprints and machine-readable test counts are separate from the original audit snapshot. No deployment or database migration was performed.