Overview
Your ASP.NET Core application loads normally, but its real-time features do not work: a SignalR chat or notification hub never connects, or a Blazor app shows the page and then stops responding. In the browser, the request to /negotiate returns 403 Forbidden. The same application works on your own computer and on other hosts.
This is caused by one rule of the Web Application Firewall on your site, not by your code. You can switch that single rule off yourself in Plesk in about a minute, and the rest of the firewall keeps protecting your site.
Symptoms
- A SignalR hub does not connect. Examples: /chatHub/negotiate, /hub/negotiate, /notificationsHub/negotiate return 403.
- A Blazor app with server interactivity loads, but buttons and forms do nothing, or you see "Attempting to reconnect to the server". The request to /_blazor/negotiate returns 403.
- The browser console shows an error such as Failed to complete negotiation with the server: Error: Status code '403' or Failed to start the connection.
- The 403 response is a plain page titled 403 - Forbidden: Access is denied, not a page from your application.
- The home page and ordinary pages of the site load without errors.
Cause
Every site on our Windows hosting is protected by the Plesk Web Application Firewall (ModSecurity with the OWASP rule set). Rule 920420 only accepts a fixed list of content types on requests that carry a body.
The SignalR browser client, which Blazor also uses, sends its negotiate request and its long-polling messages as a POST with the header Content-Type: text/plain;charset=UTF-8. That content type is not on the rule's list, so the firewall rejects the request with 403 before it reaches your application. This is how Microsoft's client library works; it is not a mistake in your application.
How to confirm it
- Open your site in the browser and press F12 to open the developer tools.
- Open the Network tab and reload the page.
- Find the request whose name starts with negotiate?negotiateVersion=1.
- If its status is 403 and its request headers show Content-Type: text/plain;charset=UTF-8, this article applies to you.
If the status is 401, your application is asking for a login, which is a different matter. If it is 404, the hub address in your client code does not match the one your application maps.
Solution: switch off rule 920420 for your site
- Log in to Plesk.
- Go to Websites & Domains and find the site that shows the error. If the error is on a subdomain, such as staging.example.com, choose that subdomain. Each site and subdomain has its own firewall settings.
- Click Web Application Firewall.
- Leave Web application firewall mode set to On.
- Under Switch off security rules, type 920420 in the Security rule IDs box. If the box already contains other numbers, add 920420 on a new line.
- Click OK.
- Go back to the site, open Dedicated IIS Application Pool and click Recycle so the change takes effect at once.
- Reload your page with Ctrl+F5 and test again. The negotiate request should now return 200.
Repeat these steps for every site or subdomain that runs SignalR or Blazor.
Is it safe to switch this rule off?
Yes. Rule 920420 is a content-type policy check, not an attack signature. With it switched off, the firewall still blocks SQL injection, cross-site scripting, path traversal, known scanners and the other attack patterns on your site.
Please do not turn the whole firewall off to solve this. Detection only mode also makes the error go away, but it stops the firewall from blocking anything on that site, so use it only as a short test.
If the error is still there
- Make sure you changed the setting on the exact site or subdomain that returns the 403.
- Recycle the application pool again and clear the browser cache.
- In Plesk, open Web Application Firewall for the site and view the ModSecurity audit log. Each blocked request lists the rule ID that stopped it.
- If a different rule ID appears, or you would like us to make the change for you, open a support ticket and include the full address that returns 403 and the time you tried it. We will check the firewall log for your site and apply the exclusion.