X-Content-Type-Options: nosniff header missing
Browsers sometimes guess a file's type from its contents instead of trusting the Content-Type header. If users can upload files, or an endpoint returns text you do not fully control, that guessing can turn a harmless looking file into a script or a page that runs on your domain. The X-Content-Type-Options: nosniff header turns the guessing off and makes the browser block scripts and stylesheets served with the wrong type. The fix is one header on every response, plus correct Content-Type values for the files you serve.
The fix
$ curl -sI https://yourapp.com | grep -i x-content-type-options
$module.exports = {
async headers() {
return [
{
source: "/(.*)",
headers: [{ key: "X-Content-Type-Options", value: "nosniff" }],
},
];
},
};How ShipReady finds it
shipready url requests your page once and reports when the response has no X-Content-Type-Options header. Findings carry rule ID SR-WEB-004.
Run the check
npx @shipmate-agency/shipready url https://yourapp.comThe GitHub Action deeflect/shipready@v0.2.0 scans the repo only, so run this check against your deployed site.
Want a person to check every area and send the fixes as pull requests? Launch Lockdown, $950 once.