Skip to content

Commit

Permalink
Merge pull request #1875 from riganti/sec-fetch-check-preloading-info
Browse files Browse the repository at this point in the history
Add info about pre-loading to the Sec-Fetch-Dest GET check
  • Loading branch information
tomasherceg authored Nov 3, 2024
2 parents a5be62b + fc2ace5 commit 22f9e4b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Framework/Framework/Hosting/DotvvmPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,11 @@ Cross site iframe are disabled in this application.
if (context.RequestType is not DotvvmRequestType.SpaNavigate)
await context.RejectRequest($"""
Pages can not be loaded using Javascript for security reasons.
Try refreshing the page to get rid of the error.
If you are the developer, you can disable this check by setting DotvvmConfiguration.Security.VerifySecFetchForPages.ExcludeRoute("{route}"). [dest: {dest}, site: {site}]
If you are the developer, you can disable this check by setting DotvvmConfiguration.Security.VerifySecFetchForPages.ExcludeRoute("{route}").
Note that this security check is not compatible with page preloading, such as TurboLinks, Cloudflare Speed Brain, or similar. You'll need to disable one of these. The check is "only" a deference-in-depth measure against XSS and disabling it is perfectly safe in the absence of other vulnerabilities.
""");
if (site != "same-origin")
await context.RejectRequest($"Cross site SPA requests are disabled.");
Expand Down

0 comments on commit 22f9e4b

Please sign in to comment.