403 Forbidden for signed-in users of an ASP.NET Core site (Web Application Firewall and the sign-in cookie) Print

  • 0

Overview

Your ASP.NET Core site works, but now and then a signed-in user gets 403 Forbidden on every page. Other users are fine at the same moment, and the affected user is often fine again after signing out and back in. Nothing in your application log explains it.

This is a false positive of the Web Application Firewall: it read the encrypted sign-in cookie as an attack. It is not a fault in your code and it is not an attack.

Since December 4, 2026 our firewall no longer inspects the ASP.NET sign-in and anti-forgery cookies on any site. A site starts using this the next time its application pool starts. If you still see the error, recycle the application pool of the site once (steps below).

Symptoms

  • A plain page titled 403 - Forbidden: Access is denied, not a page from your application.
  • It affects one user or browser at a time, on every address of the site including the home page and static files.
  • It starts right after signing in, or some time later when the application renews the sign-in cookie.
  • Clearing the cookies for the site, or using a private window, makes the site load again.
  • The firewall log for the site names a rule whose number starts with 942 together with the text REQUEST_COOKIES:.AspNetCore.Identity.Application (or another cookie from the list below), followed by rule 949110 (Inbound Anomaly Score Exceeded). Rules seen so far: 942450 (SQL Hex Encoding Identified) and 942210 (Detects chained SQL injection attempts 1/2).

Cause

Every site on our Windows hosting is protected by the Plesk Web Application Firewall (ModSecurity with the OWASP rule set). Its SQL injection rules look for short pieces of text that attacks use, for example 0x followed by letters and digits (rule 942450), or a digit, the word or, a digit and a dash, as in 9or8- (rule 942210).

ASP.NET Core keeps the sign-in in an encrypted cookie. Its value is a long run of random-looking letters, digits, dashes and underscores. By chance, that value sometimes contains one of those pieces of text. The firewall then treats the cookie as an attack and rejects every request that carries it. A new cookie has a new value, which is why signing in again usually clears it, and why it can come back days later with a different rule number.

Cookies the firewall no longer inspects

  • .AspNetCore.Identity.Application (ASP.NET Core Identity)
  • .AspNetCore.Cookies (ASP.NET Core cookie sign-in)
  • The numbered parts of those two cookies when the value is long, for example .AspNetCore.CookiesC1
  • .ASPXAUTH and .AspNet.ApplicationCookie (ASP.NET 4.x)
  • .AspNetCore.Antiforgery.… (the ASP.NET Core anti-forgery cookie)

Everything else in a request is still inspected by every rule: the address, form fields, headers and all other cookies. The firewall stays on.

Solution: recycle the application pool once

  1. Log in to Plesk.
  2. Go to Websites & Domains and find the site that shows the error.
  3. Open Dedicated IIS Application Pool for Website.
  4. Click Recycle.
  5. Sign in to your site again and retry.

The recycle signs out the users of that site once, unless your application stores its Data Protection keys in a folder (see the related article below). You do not need to switch off any firewall rule, and you do not need to open a ticket.

How to confirm it

  1. Log in to Plesk, go to Websites & Domains and open Web Application Firewall for the site that shows the error.
  2. Open the ModSecurity audit log and look for the time of the 403. The log shows the time of the server, which is US Eastern Time.
  3. If the entry names one of the cookies above after REQUEST_COOKIES:, this article applies to you.

If the log names a different cookie

The same can happen with other cookies that hold encrypted or random text, for example a sign-in cookie you gave your own name, or a cookie set by a third-party script. Those are still inspected. You have two choices:

  • Ask us. Open a support ticket with the site address, the rule ID and the cookie name from the firewall log. We exclude that one cookie on your site; the rules keep checking everything else.
  • Do it yourself. In Plesk, open Web Application Firewall for the site, leave the mode On, type the rule ID from the log in the Security rule IDs box under Switch off security rules, click OK, then recycle the application pool. This switches that one rule off for the whole site; the other rules stay on.

Please do not turn the whole firewall off, and do not leave it in Detection only mode: both stop the firewall from blocking anything on that site.

Until the pool is recycled

An affected user can get back in at once by clearing the cookies for your site in the browser and signing in again.

If the error is still there

  • Make sure you recycled the application pool of the exact site or subdomain that returns the 403.
  • Check the firewall log again. If it still names one of the sign-in cookies listed above after a recycle, open a support ticket and include the full address that returns 403, the time you tried it and the lines of the log entry.

Related articles


Was this answer helpful?

« Back