Strict-Transport-Security header missing
Strict-Transport-Security tells the browser to use HTTPS for your domain on every later visit, even when someone types the address without it or follows an old http link. Without it, a request can go out over plain HTTP, where someone on the same network can read or redirect it before your redirect to HTTPS arrives. The fix is to send Strict-Transport-Security: max-age=63072000; includeSubDomains on HTTPS responses. Browsers ignore the header when it arrives over HTTP. Add preload only once every subdomain serves HTTPS.
The fix
$ curl -sI https://yourapp.com | grep -i strict-transport-security
$module.exports = {
async headers() {
return [
{
source: "/(.*)",
headers: [{ key: "Strict-Transport-Security", value: "max-age=63072000; includeSubDomains" }],
},
];
},
};How ShipReady finds it
shipready url requests your page once and reports when the response has no Strict-Transport-Security header. Findings carry rule ID SR-WEB-002.
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.