Summary
Kalmia's RsPressMiddleware can allow access to private documentation when a request includes any non-empty viewToken cookie. Because the cookie is not validated as a JWT, an unauthenticated requester may be able to read documentation pages and assets on affected sites.
Affected context
The issue occurs in Kalmia's RsPressMiddleware when it protects a RequireAuth documentation site. Risk arises if the middleware treats the presence of a viewToken cookie as sufficient authorization instead of validating the token before serving protected pages or assets.
Exploit preconditions
- Attack surface: Requests to a documentation site protected by RsPressMiddleware
- Required access: No prior authentication is required
- Trigger point: A request includes a non-empty
viewTokencookie - Why exploitation is possible: The cookie is accepted without JWT validation, allowing the authorization check to be bypassed
Why this happens
The middleware relies on the presence of a client-controlled cookie rather than verifying the authenticity and validity of the associated credential. This is an authentication decision flaw mapped to CWE-287: Improper Authentication.
Potential impact
- Unauthorized readers may access private documentation pages
- Documentation assets that are served through the same protection mechanism could be exposed
- Sensitive information published in protected documentation could be disclosed
General mitigation guidance
Defensive patterns include validating authentication credentials cryptographically and enforcing authorization on every protected resource request. Avoid treating the presence or format of a client-controlled cookie as proof of identity; use secure-by-default authentication middleware, limit access to sensitive documentation, and apply least-privilege access controls.
How teams detect issues like this
Review authentication middleware for authorization decisions based only on cookie presence or other client-controlled values. Use static analysis and code review to identify missing token signature, claims, and expiry checks. Policy checks can require protected routes to use established authentication components and ensure access-control tests cover requests with absent, malformed, and invalid credentials.

