Join our Newsletter — 33% off our NHI Course

Notifications
Clear all

Client-side path traversal in SPAs: are your route controls enough?


(@nhi-mgmt-group)
Member Moderator
Joined: 1 year ago
Posts: 18936
Topic starter  

TL;DR: Client-side path traversal in single-page applications lets attackers manipulate URLs to reach hidden routes, expose sensitive data, or bypass frontend-only controls, according to Jscrambler. The security lesson is that route hiding is not authorisation, and server-side checks must remain the source of truth.

NHIMG editorial — based on content published by Jscrambler: client-side path traversal in single-page applications and how to defend against it

Questions worth separating out

Q: What breaks when SPA route controls are not backed by server-side authorization?

A: Users can change the URL and reach views that were only hidden in the browser, because client-side routing is not a trusted security boundary.

Q: Why do client-side path traversal issues matter to IAM and identity teams?

A: They matter because identity policy only works if it is enforced at the point where data is released.

Q: How do you know SPA security testing is actually working?

A: You know testing is working when it can reproduce the app’s real interactive paths, including token handling, API calls, and state changes that occur after rendering.

Practitioner guidance

  • Enforce server-side authorisation on every protected request Require backend checks for roles, entitlements, and object access before any sensitive data is returned, even if the route is already hidden in the SPA.
  • Replace dynamic routes with explicit route definitions Use static route maps and whitelist validation for all path parameters so user-controlled input cannot reshape navigation into an internal view or API call.
  • Test route fuzzing in security reviews Add manual and automated tests that mutate URL paths, query strings, and route parameters to confirm the application rejects unauthorized views and does not leak data.

What's in the full article

Jscrambler's full article covers the implementation detail this post intentionally leaves at the analysis layer:

  • Concrete examples of unsafe route construction in SPAs and how attackers manipulate them.
  • Step-by-step defensive patterns for static route definitions, validation, and backend enforcement.
  • Build and CI/CD integration details for applying client-side protections before deployment.
  • Runtime protection and anti-tampering behaviours that can help limit route manipulation attempts.

👉 Read Jscrambler's analysis of client-side path traversal in SPAs →

Client-side path traversal in SPAs: are your route controls enough?

Explore further

View Full Forum →  |  NHI Foundation Course →



   
Quote
(@mr-nhi)
Member Moderator
Joined: 3 months ago
Posts: 18527
 

Frontend route control is not a security boundary. SPA frameworks make it easy to change views without reloading the page, but that convenience can mask a deeper governance error: treating URL paths as proof of access. When the backend does not enforce authorisation on every protected request, route hiding becomes a cosmetic control. Practitioners should assume any client-visible path can be probed and must be validated server-side.

A question worth separating out:

Q: What should teams do when a hidden SPA route exposes sensitive data?

A: Treat it as an access-control defect, not just a frontend bug. Disable reliance on client-only checks, patch the route and the downstream API, and revalidate every path that returns user, admin, or token-related data. Then retest with route fuzzing so the same pattern does not reappear.

👉 Read our full editorial: Client-side path traversal in SPAs exposes hidden routes and data



   
ReplyQuote
Share: