How to do stateless (session-less) & cookie-less authentication?

Ah, I love these questions – maintaining a session without a session. I’ve seen multiple ways to do this during my stints during application assessments. One of the popular ways is the playing tennis way that you mentioned – sending the username and password in every request to authenticate the user. This, in my opinion, … Read more

Is there a way to force apache to return 404 instead of 403?

RedirectMatch as in e.g. RedirectMatch 404 /\. does the trick, it prohibits access to all files or directories starting with a dot, giving a “404 Not Found” error. From the Apache manual: “The Redirect[Match] directive maps an old URL into a new one by asking the client to refetch the resource at the new location.” … Read more

How to manually decrypt an ASP.NET Core Authentication cookie?

Decrypting the Authentication Cookie without needing the keys It’s worth noting that you don’t need to gain access to the keys to decrypt the authentication cookie. You simply need to use the right IDataProtector created with the right purpose parameter, and subpurpose parameters. Based on the CookieAuthenticationMiddleware source code https://github.com/aspnet/Security/blob/rel/1.1.1/src/Microsoft.AspNetCore.Authentication.Cookies/CookieAuthenticationMiddleware.cs#L4 it looks like the purpose … Read more

Should JWT be stored in localStorage or cookie? [duplicate]

I like the XSRF Double Submit Cookies method which mentioned in the article that @pkid169 said, but there is one thing that article doesn’t tell you. You are still not protected against XSS because what the attacker can do is inject script that reads your CSRF cookie (which is not HttpOnly) and then make a … Read more