Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reversed X-XSS #13936

Conversation

AaronSadlerUK
Copy link
Contributor

@AaronSadlerUK AaronSadlerUK commented Mar 9, 2023

Prerequisites

Fixes #13341

Description

This reverses the health check to warn if it does exist with a link to the Mozilla website which explains why it should not exist

I have also changed the readmore button to be nullable (it's not always required) and added a bool to reverse the check in the base class

@github-actions
Copy link

github-actions bot commented Mar 9, 2023

Hi there @AaronSadlerUK, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@tristanjthompson
Copy link
Contributor

Bristol Hackathon testing!

I've tested a vanilla install without the X-XSS-Protection header and the health check correctly passed and looks as follows ✔️
image

I've updated the install to produce the X-XSS-Protection header, and the health check correctly failed and looks as follows ✔️

image

Clicking the "Mozilla" link shold take me to the Mozilla info page with more info on the header, however it takes me to the Umbraco docs for the health check ❌

Just need to update that URL and I'm happy it's passing 👍

@AaronSadlerUK
Copy link
Contributor Author

Corrected in commit 5d07968

Thanks!

@tristanjthompson
Copy link
Contributor

Re-testing:

Testing passed ✅✅✅ thanks @AaronSadlerUK!

@nul800sebastiaan
Copy link
Member

Teamwork, thanks very much both, this is now merged for 11.3! 👍

bergmania pushed a commit that referenced this pull request Mar 16, 2023
…ons.xml (#13979)

* Revert breaking changes introduced by PR #13936

* Update PackageValidationBaselineVersion to 11.0.0 (stable version) and remove all CompatibilitySuppressions.xml files

* Fix build pipeline (pack solution again, avoiding trying to pack template projects)
@nul800sebastiaan
Copy link
Member

Hey @AaronSadlerUK! In all my excitement and GitHub not showing the builld failing I merged this with not a glance at the code, but unfortunately we have a few breaking changes there so we had to roll this one back unfortunately. It would be really great if you'd like to try this one again though!

The changes that were breaking:

  • Removing public const XssProtectionCheck is a binary breaking change
  • Adding more arguments to the public class BaseHttpHeaderCheck is a breaking change
  • And although making the ReadMoreLink property nullable isn't a binary breaking change, it is a compiler breaking change, since it might require adding a null check (and can even fail rebuilding when you have <WarningsAsErrors>Nullable</WarningsAsErrors> set).

I have't looked deeply into this PR at all but if you could address the above issues then we could give it another go! Thanks again for this attempt and sorry that I was a bit too quick on the trigger on merging this one.

@JasonElkin
Copy link
Contributor

JasonElkin commented Mar 17, 2023

I don't think the BaseHttpHeaderCheck is a good abstraction for what we're trying to do here - hence needing breaking changes to make it useful.

I started working on a PR to obsolete it. For a proper separation of concerns I think we need an "IHttpHeader" service (or helper) - it really doesn't make sense to encapsulate the general HTTP Header checks inside a base healthcheck.

Also, judging by the MDN docs, we don't necessarily want to ensure it's not there - we need to check its actual value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

X-XSS-Protection health check is out of date
4 participants