Security headers are HTTP response headers that your web server sends along to a visitor's browser. They contain instructions on how the browser should interact with your website content to prevent attacks such as cross-site scripting(XSS), clickjacking and man-in-the-middle attacks. In practice, they work as a set of security rules that you activate at server level, without having to modify your website code. For SMEs with an online shop, customer portal or WordPress site, security headers are one of the most effective and approachable ways to increase security.
How security headers work on a technical level
Every time a browser requests a page from your website, your web server sends back an HTTP response. That response consists of the visible content (HTML, CSS, images) plus a series of headers with metadata. Security headers are specific instructions within that metadata. For example, a header like Content-Security-Policy tells the browser which scripts, images and style sheets it may or may not load. X-Frame-Options blocks your site from loading into an iframe on another website, preventing clickjacking. Strict-Transport-Security enforces HTTPS even if a user accidentally follows an HTTP link. These headers are interpreted by modern browsers and thus work without visitors noticing.
Why security headers came into being and why they are crucial now
Security headers were developed from the early 2000s in response to large-scale attacks in which malicious actors exploited the way browsers handled external content. Cross-site scripting, where attackers inject scripts into your site, was one of the most common vulnerabilities. Browsers initially executed any code they encountered, without looking critically at the source. With the introduction of headers such as Content-Security-Policy and X-XSS-Protection, website owners were for the first time given the ability to limit that default behaviour. According to the W3C Content Security Policy Level 3 specification, these headers are now part of the web standard. In practice, websites without security headers are more vulnerable to data theft, phishing and reputation damage.
What security headers bring to SME companies
Voor een Nederlandse webshop of dienstverlener met een klantportaal betekenen security headers een directe verlaging van het risico op datalekken en aanvallen. Een webshop die persoonsgegevens en betaalgegevens verwerkt, moet voldoen aan de AVG-verplichtingen rond beveiliging. Security headers zijn een van de technische maatregelen die je kunt aantonen bij een audit. Daarnaast waarderen zoekmachines zoals Google sites met een sterke beveiligingsconfiguratie hoger, omdat ze veiliger zijn voor gebruikers. Bij een goed geconfigureerde WordPress hosting-omgeving worden security headers standaard ingesteld op serverniveau, waardoor je als ondernemer niet zelf met .htaccess-bestanden hoeft te werken. Het resultaat is een site die beter beschermd is tegen aanvallen, zonder dat je snelheid of gebruiksvriendelijkheid inlevert.