Website Security: Questions Answered
How to check whether a website is secure, which security headers to set, how Content Security Policy and DMARC work, the most common web vulnerabilities, and what to do if a site is hacked.
Each answer below gives the short version first. Open the full article for the steps, the reasons and the official sources.
19 questions on Website Security
| Question | Short answer |
|---|---|
| rel="noopener": When It Matters and When It's Noise | Rel=noopener only matters for links that open another site in a new tab with target=_blank and lack noopener or noreferrer. Since around 2021, Chrome, Firefox, Safari and Edge apply noopener to such links automatically, so a missing one is a low-risk best-practice item. |
| Stray Files in Your Web Folder That Anyone Can Download | Anything in your public web folder can be downloaded by anyone. To clear stray files in your web folder, list non-page files such as .txt, .bak and .old, check which return a 200 status, move unneeded ones to a private folder outside the web root, and confirm each now returns 404. |
| How do I check if my website is secure, and what should I do if security headers are missing? | Scan your domain with Mozilla HTTP Observatory, which grades your HTTP security headers, and check the Security issues report in Google Search Console for hacking or malware. If headers are missing, add them at your server, host or CDN, starting with the low-risk ones, and test a Content Security Policy in report-only mode before enforcing it. |
| What are the 10 most common web security vulnerabilities? | The standard reference is the OWASP Top 10, and the current edition is 2025. In order, it lists Broken Access Control, Security Misconfiguration, Software Supply Chain Failures, Cryptographic Failures, Injection, Insecure Design, Authentication Failures, Software or Data Integrity Failures, Security Logging and Alerting Failures, and Mishandling of Exceptional Conditions. |
| What is a Content Security Policy, and what does default-src mean? | A Content Security Policy is an HTTP response header that tells browsers which sources a page may load scripts, styles, images and other resources from, mainly to defend against cross-site scripting. default-src is the fallback value the browser uses for any fetch directive, such as script-src or img-src, that the policy does not set. |
| How do I fix a hacked website? | Take the site offline, tell your host and change every password, then find the weakness the attacker used. Restore from a clean backup or rebuild, update all software, remove anything the attacker added, and only then ask Google to review the site through the Security issues report in Search Console. |
| What is DMARC, is it now required, and how do I add it? | DMARC is an email authentication, policy and reporting protocol that builds on SPF and DKIM. Gmail requires it if you send more than 5,000 messages a day to Gmail accounts, Microsoft requires it for domains sending 5,000 or more messages to Outlook.com, and Yahoo requires it of bulk senders. You add it as a DNS TXT record at _dmarc.yourdomain, starting with p=none and moving to quarantine and reject. |
| What is personal data under GDPR, and what does a compliance statement look like? | Under GDPR, personal data is information that relates to an identified or identifiable living person, directly or when combined with other information. Names, ID numbers, location data and online identifiers such as IP addresses and cookie IDs can all qualify. A compliance statement is usually a privacy notice explaining why you process data, how long you keep it and who you share it with. |
| What are HTTP security headers, and what is HSTS? | HTTP security headers are response headers that tell browsers to apply extra protections to your site, such as Content-Security-Policy to limit what code can load. HSTS is one of them: the Strict-Transport-Security header tells browsers to use only HTTPS for your domain, upgrade HTTP requests automatically and block users from bypassing certificate errors. |
| What does GDPR compliant mean for a website, and how do you get there? | GDPR compliant means handling personal data in line with the seven data protection principles in Article 5 and being able to demonstrate that you do. For a website, that covers knowing what data you collect and why, telling people through a privacy notice, collecting only what you need, keeping it secure and accurate, deleting it on time and handling requests from individuals. |
| Why is web security important, and how do you audit a website? | Web security is important because a weak site exposes visitors to tampering and eavesdropping, and exposes the owner to Google warnings such as "This site may be hacked" and browser warning pages. Audit a website by scanning its headers and redirects with MDN HTTP Observatory, checking Search Console's Security Issues report, then testing deeper with the OWASP Web Security Testing Guide. |
| How do you keep bots off your website, and can Cloudflare help? | Keep bots off your website in layers. Use robots.txt to ask well behaved crawlers to stay out, then block or challenge the rest at the server or CDN, because robots.txt is not access control. Cloudflare can help: Bot Fight Mode is available on the free plan, paid plans add Super Bot Fight Mode, and its AI crawler policies let you block or allow AI bots. |
| What should a DMARC record look like, and can you have more than one? | A DMARC record is a single DNS TXT record published at _dmarc on your domain, starting with v=DMARC1, followed by a policy such as p=none, p=quarantine or p=reject and usually a rua address for reports. You must have only one. Under RFC 9989, if a receiver finds more than one DMARC record for the same name, it discards them all, so no DMARC policy is found at that name. |
| What is the difference between CORS and Content Security Policy? | CORS and Content Security Policy do different jobs. CORS is a set of response headers that lets a server relax the same-origin policy so that scripts on other origins can read its responses. Content Security Policy is a response header that restricts what your own page may load and execute, mainly to limit cross-site scripting. CORS opens a controlled door to your data, while CSP locks down your page. |
| Does HTTPS mean a website is safe, and can a fake site have HTTPS? | Does HTTPS mean a website is safe? No. HTTPS means the connection between your browser and the site is encrypted, so others on the network cannot read or alter what you send. It does not prove the site is honest. A fake or scam site can obtain a free domain validated certificate in minutes, so the padlock only confirms you are talking privately to whoever controls that domain. |
| How do you check whether an SSL certificate is valid, and why are certificates getting shorter (200 days)? | An SSL certificate is valid when it is issued by a trusted authority, covers the exact domain you are visiting, has a complete chain and has not expired or been revoked. Since 15 March 2026 the CA/Browser Forum caps new public certificates at 200 days, falling to 100 days in 2027 and 47 days in 2029, so automated renewal is now essential. |
| What is website spoofing? | Website spoofing is creating a fake website that imitates a real organisation, such as a bank, shop or government service, to trick visitors into entering passwords, payment details or personal information, or into downloading malware. Spoofed sites often use lookalike addresses and copied branding, and many have a valid HTTPS padlock. They are usually reached through phishing emails, texts or adverts. |
| How can you tell if a website is legit? | You can tell if a website is legit by checking several things together: the exact domain name, how you arrived there, real contact details and policies, the absence of pressure tactics, and any browser warnings. No single signal is proof. The HTTPS padlock only shows an encrypted connection, so scam sites can have one. If something feels wrong, contact the organisation through details you already trust. |
| What should you do if you open a suspicious website by accident? | If you open a suspicious website by accident, close the page straight away without clicking anything or entering details. If nothing was downloaded and you typed nothing, the risk is usually low. Run a full antivirus scan, keep your browser and device updated, and report the site to the NCSC. If you entered a password, change it on every account that uses it. If you shared bank details, contact your bank immediately. |