<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Masahiro Kurokawa</title>
    <description>The latest articles on DEV Community by Masahiro Kurokawa (@masahirokurokawa).</description>
    <link>https://dev.to/masahirokurokawa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4260805%2F86c8311b-0803-45e9-a001-de5290660918.png</url>
      <title>DEV Community: Masahiro Kurokawa</title>
      <link>https://dev.to/masahirokurokawa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/masahirokurokawa"/>
    <language>en</language>
    <item>
      <title>Clickjacking protection: when another site embeds your pages</title>
      <dc:creator>Masahiro Kurokawa</dc:creator>
      <pubDate>Sat, 28 Nov 2026 02:10:11 +0000</pubDate>
      <link>https://dev.to/masahirokurokawa/clickjacking-protection-when-another-site-embeds-your-pages-4ao5</link>
      <guid>https://dev.to/masahirokurokawa/clickjacking-protection-when-another-site-embeds-your-pages-4ao5</guid>
      <description>&lt;p&gt;You have heard the word "clickjacking" and have no idea what to do about it. It shows up in scan results, but it is hard to connect to anything you recognize.&lt;/p&gt;

&lt;p&gt;The short answer is one line: &lt;strong&gt;stop other sites from embedding your pages&lt;/strong&gt;. Send &lt;code&gt;Content-Security-Policy: frame-ancestors 'none'&lt;/code&gt; and the whole family of framing attacks stops working.&lt;/p&gt;

&lt;h2&gt;
  
  
  What clickjacking is
&lt;/h2&gt;

&lt;p&gt;Picture a restaurant menu with a clear sheet laid over it. Your finger points at one dish, but a different dish is what gets ordered. That is clickjacking.&lt;/p&gt;

&lt;p&gt;Clickjacking is an attack that shows your page inside the attacker's page using an iframe (a part that embeds one page inside another) and lays a transparent button or text on top. The visitor believes they are looking at your site, but the button they press belongs to the attacker.&lt;/p&gt;

&lt;p&gt;Nothing about your site looks different. What changes is where the click lands.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it concerns you
&lt;/h2&gt;

&lt;p&gt;The target is a visitor who is still signed in. They are made to press a button on your site against their intent.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;confirming a payment or an order&lt;/li&gt;
&lt;li&gt;deleting an account, switching a page between public and private&lt;/li&gt;
&lt;li&gt;changing permissions or an email address&lt;/li&gt;
&lt;li&gt;following, liking, posting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, the attacker's page says "You have won" in large letters. Your site's "Delete" button is laid over it, invisibly. The visitor thinks they pressed the prize button and presses Delete instead.&lt;/p&gt;

&lt;p&gt;The more your site has forms, logins, or payments, the more this matters. Even a static profile page can be embedded somewhere else and shown out of context.&lt;/p&gt;

&lt;h2&gt;
  
  
  One line that refuses embedding
&lt;/h2&gt;

&lt;p&gt;The answer is to refuse embedding in a response header. There are two ways to say it, and either one works.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Content-Security-Policy: frame-ancestors 'none'&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;X-Frame-Options: DENY&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;frame-ancestors&lt;/code&gt; is the current form, and &lt;code&gt;X-Frame-Options&lt;/code&gt; is for old browsers. Sending both is fine. Modern browsers give &lt;code&gt;frame-ancestors&lt;/code&gt; priority.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;X-Frame-Options&lt;/code&gt; has an &lt;code&gt;ALLOW-FROM&lt;/code&gt; form, but almost no current browser supports it, and it cannot list more than one origin. If you need to allow a partner, use &lt;code&gt;frame-ancestors&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;frame-ancestors&lt;/code&gt; does not work in an HTML meta tag.&lt;/strong&gt; It has to come back as a header.&lt;/p&gt;

&lt;h2&gt;
  
  
  When you do want to allow embedding
&lt;/h2&gt;

&lt;p&gt;Sometimes a payment or booking widget needs to be embedded on a partner's site. In that case, allow only that origin (the combination of scheme, host, and port).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Content-Security-Policy: frame-ancestors https://partner.example&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;'self'&lt;/code&gt; means "only this site". Add &lt;code&gt;'self'&lt;/code&gt; only if your own pages embed each other. &lt;code&gt;'none'&lt;/code&gt; means "no one may embed this", including yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it looks in vuln
&lt;/h2&gt;

&lt;p&gt;vuln (&lt;a href="https://ismyappok.com/en/vuln?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=clickjacking" rel="noopener noreferrer"&gt;a free check that runs on a public URL&lt;/a&gt;) shows clickjacking as one row, V04.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;V04 Clickjacking (area: Headers, priority 3)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;V04 looks at the response headers of the top page.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;X-Frame-Options&lt;/code&gt; is present: pass&lt;/li&gt;
&lt;li&gt;the CSP header has &lt;code&gt;frame-ancestors&lt;/code&gt;: pass&lt;/li&gt;
&lt;li&gt;neither is present: needs work&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It only checks &lt;strong&gt;presence&lt;/strong&gt;. It does not tell &lt;code&gt;DENY&lt;/code&gt; from &lt;code&gt;SAMEORIGIN&lt;/code&gt;, or look at which origins you allow. If you want to judge the strength of the value, read the headers yourself.&lt;/p&gt;

&lt;p&gt;A CSP in a meta tag is not used for this check, because &lt;code&gt;frame-ancestors&lt;/code&gt; does not work in meta. Even if it is written in the HTML, V04 treats it as absent.&lt;/p&gt;

&lt;p&gt;The Evidence and fix column keeps what was observed as &lt;code&gt;key=value&lt;/code&gt; lines. With neither header you see &lt;code&gt;request=GET …&lt;/code&gt;, &lt;code&gt;header=x-frame-options&lt;/code&gt;, and &lt;code&gt;note=absent; csp frame-ancestors absent&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  A measurement from our own site
&lt;/h2&gt;

&lt;p&gt;On 22 November 2026 we checked this site's response headers with &lt;code&gt;curl -sSI https://ismyappok.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The CSP header contains &lt;code&gt;frame-ancestors 'none'&lt;/code&gt;. There is no &lt;code&gt;x-frame-options&lt;/code&gt; line. V04 passes because of the CSP setting; we do not send &lt;code&gt;X-Frame-Options&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here is the main part of the CSP header (the nonce value, some sources, and some directives are omitted).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; …; upgrade-insecure-requests&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;frame-ancestors&lt;/code&gt; sits in the same header as the other CSP directives. You add one word inside CSP rather than adding another header.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to fix it
&lt;/h2&gt;

&lt;p&gt;Where you return the header depends on your hosting or framework. The official steps are here.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options" rel="noopener noreferrer"&gt;MDN's official X-Frame-Options documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/frame-ancestors" rel="noopener noreferrer"&gt;MDN's official frame-ancestors documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cheatsheetseries.owasp.org/cheatsheets/Clickjacking_Defense_Cheat_Sheet.html" rel="noopener noreferrer"&gt;OWASP's Clickjacking Defense Cheat Sheet (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.cloudflare.com/pages/configuration/headers/" rel="noopener noreferrer"&gt;Cloudflare Pages' official Headers documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.netlify.com/manage/routing/headers/" rel="noopener noreferrer"&gt;Netlify's official Headers documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vercel.com/docs/project-configuration" rel="noopener noreferrer"&gt;Vercel's official project configuration documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nextjs.org/docs/app/api-reference/config/next-config-js/headers" rel="noopener noreferrer"&gt;Next.js's official headers documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On Netlify and Cloudflare Pages, you put a &lt;code&gt;_headers&lt;/code&gt; file in the publish directory and list a path such as &lt;code&gt;/*&lt;/code&gt; with the headers. On Vercel, you write them under &lt;code&gt;headers&lt;/code&gt; in &lt;code&gt;vercel.json&lt;/code&gt;. Next.js returns them from &lt;code&gt;headers()&lt;/code&gt; in &lt;code&gt;next.config&lt;/code&gt;. If you want to add the header at Cloudflare's proxy instead, you can do it with a Transform Rule ("Modify response header").&lt;/p&gt;

&lt;p&gt;If you already send a CSP, do not add a new header; add &lt;code&gt;frame-ancestors 'none'&lt;/code&gt; inside the existing policy. Deciding on one place to set it saves confusion later.&lt;/p&gt;

&lt;p&gt;If you already followed &lt;a href="https://ismyappok.com/en/articles/security-headers?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=clickjacking" rel="noopener noreferrer"&gt;Security headers, explained&lt;/a&gt;, this is one more line in the same place. &lt;a href="https://ismyappok.com/en/articles/csp-basics?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=clickjacking" rel="noopener noreferrer"&gt;CSP basics&lt;/a&gt; covers the bigger picture of the policy.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it looks in the result screen
&lt;/h2&gt;

&lt;p&gt;"3. Result" in vuln shows a pass-rate summary and the checklist. The table has six columns: ID, Item, Priority, Result, Area, and Evidence and fix.&lt;/p&gt;

&lt;p&gt;V04 appears in the Headers area. If nothing blocks embedding, the result is "Needs work". The "Needs work only" filter keeps the row, and its priority of 3 puts it near the top.&lt;/p&gt;

&lt;h2&gt;
  
  
  What clickjacking protection does not prevent
&lt;/h2&gt;

&lt;p&gt;vuln is not a penetration test. It checks the public face of a site from the outside.&lt;/p&gt;

&lt;p&gt;Refusing embedding does not stop attacks that avoid frames: sending people to a fake site, or showing a look-alike screen in another tab. It does not look at scripts injected into the page (XSS) or holes on the server side either.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finding nothing does not mean the site is safe.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Clickjacking protection is one line, and it buys a lot, in my view. Even a site with no login or payment would rather not be embedded and shown out of context.&lt;/p&gt;

&lt;p&gt;Start with V04 in vuln. If it says "Needs work", add &lt;code&gt;frame-ancestors 'none'&lt;/code&gt; to the CSP and go from there.&lt;/p&gt;

&lt;p&gt;The fixes are collected on these pages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ismyappok.com/en/checks/clickjacking?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=clickjacking" rel="noopener noreferrer"&gt;Clickjacking protection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ismyappok.com/en/checks/csp?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=clickjacking" rel="noopener noreferrer"&gt;Content-Security-Policy (CSP)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ismyappok.com/en/checks/security-headers?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=clickjacking" rel="noopener noreferrer"&gt;Other security headers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you have changed the settings, &lt;a href="https://ismyappok.com/en/vuln?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=clickjacking" rel="noopener noreferrer"&gt;run vuln&lt;/a&gt; again. You can check display and links before launch with &lt;a href="https://ismyappok.com/en/audit?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=clickjacking" rel="noopener noreferrer"&gt;audit (no login)&lt;/a&gt; as well.&lt;/p&gt;

&lt;p&gt;This article is based on checking our own site's settings. We did not scan anyone else's site for it. The numbers are recommended values and implementation thresholds; the only measurements are the ones with the date and method given in the text.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>security</category>
      <category>webdev</category>
    </item>
    <item>
      <title>CSP basics: allow only what you mean to run, not block everything</title>
      <dc:creator>Masahiro Kurokawa</dc:creator>
      <pubDate>Fri, 27 Nov 2026 01:34:52 +0000</pubDate>
      <link>https://dev.to/masahirokurokawa/csp-basics-allow-only-what-you-mean-to-run-not-block-everything-390o</link>
      <guid>https://dev.to/masahirokurokawa/csp-basics-allow-only-what-you-mean-to-run-not-block-everything-390o</guid>
      <description>&lt;p&gt;Someone told you to add CSP, so you pasted the one line &lt;code&gt;default-src 'self'&lt;/code&gt;. What actually changed? It is easy to end up with no idea.&lt;/p&gt;

&lt;p&gt;CSP is not a way to block all scripts. It is an &lt;strong&gt;allowlist: you name what may run on the page, and everything else is stopped&lt;/strong&gt;. Start from &lt;code&gt;default-src 'self'&lt;/code&gt; and add only the sources you really use.&lt;/p&gt;

&lt;h2&gt;
  
  
  What CSP is
&lt;/h2&gt;

&lt;p&gt;Picture the front desk at an event. There is a guest list, and only people on the list get in. Anyone else stays outside, even if they are standing at the door.&lt;/p&gt;

&lt;p&gt;CSP (Content-Security-Policy) is one of the headers a server sends with its response. It tells the browser where this page may load scripts, styles, images, and frames from, and which inline code (written directly in the HTML) it may run.&lt;/p&gt;

&lt;p&gt;Nothing about the page looks different. What changes is whether the browser runs or stops code you did not expect to be there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it concerns you
&lt;/h2&gt;

&lt;p&gt;A malicious script can be slipped into a form field on your page. This attack is called XSS (cross-site scripting).&lt;/p&gt;

&lt;p&gt;If whatever people type is shown on the page as-is, the script is shown too, and it runs. Common examples are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;comment sections and reviews that put what people wrote straight onto the page&lt;/li&gt;
&lt;li&gt;profile bios and display names shown on other people's screens&lt;/li&gt;
&lt;li&gt;a search box that puts the words you typed into a heading such as "Results for …"&lt;/li&gt;
&lt;li&gt;notes and to-do lists that save what you enter and list it back&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a script written into a comment can run in the browser of someone else who opens that page.&lt;/p&gt;

&lt;p&gt;It is not the input field itself that is dangerous. If the text is treated as text (escaped) when it is displayed, the script does not run.&lt;/p&gt;

&lt;p&gt;CSP is the last resort at that moment. Even a script that made it onto the page will not run if it is not on the list.&lt;/p&gt;

&lt;p&gt;The more your site has forms, logins, payments, or contact pages, the more this matters. A purely static profile page has less to protect, but adding CSP still does no harm.&lt;/p&gt;

&lt;h2&gt;
  
  
  The basics of an allowlist
&lt;/h2&gt;

&lt;p&gt;As with the guest list at the desk, only the sources you list load on the page.&lt;/p&gt;

&lt;p&gt;Start with &lt;code&gt;default-src 'self'&lt;/code&gt;. &lt;code&gt;default-src&lt;/code&gt; is the fallback for every other directive, and &lt;code&gt;'self'&lt;/code&gt; means "only this site (the same origin)".&lt;/p&gt;

&lt;p&gt;From there, add only what you actually use.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;script-src&lt;/code&gt;: where scripts may load from&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;style-src&lt;/code&gt;: where stylesheets may load from&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;img-src&lt;/code&gt;: where images may load from&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;connect-src&lt;/code&gt;: where fetches (APIs, analytics) may go&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;font-src&lt;/code&gt;: where fonts may load from&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;frame-src&lt;/code&gt;: where iframes (another page embedded in this one) may load from&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;'none'&lt;/code&gt; means "load from nowhere". It is a good idea to add &lt;code&gt;object-src 'none'&lt;/code&gt; and &lt;code&gt;base-uri 'self'&lt;/code&gt; from the start. &lt;code&gt;object&lt;/code&gt; is an old plugin entry point, and a &lt;code&gt;base&lt;/code&gt; tag can rewrite where links on the page point.&lt;/p&gt;

&lt;p&gt;Do not use &lt;code&gt;*&lt;/code&gt; or &lt;code&gt;http:&lt;/code&gt;. &lt;code&gt;*&lt;/code&gt; means "from anywhere", which defeats the allowlist. &lt;code&gt;http:&lt;/code&gt; allows sources that are not encrypted.&lt;/p&gt;

&lt;h2&gt;
  
  
  unsafe-inline and nonces
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;'unsafe-inline'&lt;/code&gt; allows scripts and styles written directly in the HTML. &lt;code&gt;'unsafe-eval'&lt;/code&gt; allows &lt;code&gt;eval()&lt;/code&gt; and similar calls that run a string as code.&lt;/p&gt;

&lt;p&gt;Both weaken CSP a great deal. MDN warns that they defeat much of the purpose of having a CSP.&lt;/p&gt;

&lt;p&gt;The alternatives are nonces and hashes. A nonce is a one-time pass that changes with every response; only a &lt;code&gt;&amp;lt;script nonce="..."&amp;gt;&lt;/code&gt; that matches the &lt;code&gt;'nonce-...'&lt;/code&gt; in the header runs. A hash is a fingerprint computed from the code itself.&lt;/p&gt;

&lt;p&gt;When &lt;code&gt;script-src&lt;/code&gt; contains a nonce, a hash, or &lt;code&gt;'strict-dynamic'&lt;/code&gt;, the browser ignores &lt;code&gt;'unsafe-inline'&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;vuln is a check that looks at the settings of a public URL from the outside (&lt;a href="https://ismyappok.com/en/vuln?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=csp-basics" rel="noopener noreferrer"&gt;vuln&lt;/a&gt;). It does not call the policy weak when &lt;code&gt;'unsafe-inline'&lt;/code&gt; is the only problem. If &lt;code&gt;'unsafe-eval'&lt;/code&gt; is still there, however, the result is "Needs work".&lt;/p&gt;

&lt;p&gt;&lt;code&gt;'strict-dynamic'&lt;/code&gt; extends the trust given by a nonce or hash to scripts that the trusted script loads later. It also ignores host lists and &lt;code&gt;'self'&lt;/code&gt;, so it takes some getting used to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do not enforce it straight away
&lt;/h2&gt;

&lt;p&gt;Adding CSP can stop scripts that used to work. The more external scripts your site uses (analytics, chat, payments, ads), the more likely that is.&lt;/p&gt;

&lt;p&gt;That is what &lt;code&gt;Content-Security-Policy-Report-Only&lt;/code&gt; is for. It does not enforce anything; it only reports violations. Run it for about a week and see what would break.&lt;/p&gt;

&lt;p&gt;To receive the reports, declare the destination in a &lt;code&gt;Reporting-Endpoints&lt;/code&gt; header and name it in &lt;code&gt;report-to&lt;/code&gt;. Also include &lt;code&gt;report-uri&lt;/code&gt; for older browsers. A report tells you which directive was violated and which URL was not loaded.&lt;/p&gt;

&lt;p&gt;But Report-Only &lt;strong&gt;does not enforce&lt;/strong&gt;, so V02 in vuln stays at "Needs work". vuln looks for the enforcing header or a meta tag (a setting written inside the page). With a report-only policy, the internal record keeps &lt;code&gt;note=report-only-only&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it looks in vuln
&lt;/h2&gt;

&lt;p&gt;CSP appears in two rows of the vuln result table.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;V02 CSP present (area: Headers, priority 3)&lt;/li&gt;
&lt;li&gt;V03 CSP weaknesses (area: Headers, priority 2)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;V02 checks whether the top page has a CSP in its response headers or in the HTML meta tag. If neither is there, the result is "Needs work".&lt;/p&gt;

&lt;p&gt;V03 looks inside the policy when one exists.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;script-src&lt;/code&gt; (or &lt;code&gt;default-src&lt;/code&gt; if there is no &lt;code&gt;script-src&lt;/code&gt;) has both &lt;code&gt;'unsafe-inline'&lt;/code&gt; and &lt;code&gt;'unsafe-eval'&lt;/code&gt;: Needs work&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;script-src&lt;/code&gt; has &lt;code&gt;*&lt;/code&gt; or &lt;code&gt;http:&lt;/code&gt;: Needs work&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;default-src&lt;/code&gt; has &lt;code&gt;*&lt;/code&gt;: Needs work&lt;/li&gt;
&lt;li&gt;only &lt;code&gt;'unsafe-inline'&lt;/code&gt; is present (no nonce, hash, or &lt;code&gt;'strict-dynamic'&lt;/code&gt;): Check&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;object-src&lt;/code&gt; or &lt;code&gt;base-uri&lt;/code&gt; is missing: Check&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;frame-ancestors&lt;/code&gt; is handled by V04 (clickjacking), so V03 does not report it.&lt;/p&gt;

&lt;p&gt;Here is an easy-to-miss point. &lt;strong&gt;If there is no CSP at all, V03 shows as a pass.&lt;/strong&gt; V03 asks whether the policy is weak; the absence of a policy belongs to V02. If V02 says "Needs work", fix V02 first.&lt;/p&gt;

&lt;h2&gt;
  
  
  A measurement from our own site
&lt;/h2&gt;

&lt;p&gt;On 21 November 2026 we checked this site's response headers with &lt;code&gt;curl -sSI https://ismyappok.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here are the main directives from the CSP header (the nonce value, some sources, and some directives are omitted).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; …; script-src 'self' 'nonce-…' https://static.cloudflareinsights.com …; connect-src 'self' https://static.cloudflareinsights.com …; upgrade-insecure-requests&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Three things follow.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The CSP header is present, so V02 is a pass&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;script-src&lt;/code&gt; has neither &lt;code&gt;'unsafe-inline'&lt;/code&gt; nor &lt;code&gt;'unsafe-eval'&lt;/code&gt;, and no &lt;code&gt;*&lt;/code&gt; or &lt;code&gt;http:&lt;/code&gt;, so V03 is a pass&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;object-src&lt;/code&gt; and &lt;code&gt;base-uri&lt;/code&gt; are present, so there is no missing-directive finding&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We do not use a meta tag. The nonce is generated per response, so opening the same URL again gives a different value.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to fix it
&lt;/h2&gt;

&lt;p&gt;The order is: list what you use, start small, test with Report-Only, then enforce.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;List&lt;/strong&gt;: the external scripts you use (analytics, ads, chat, payments, fonts)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Start small&lt;/strong&gt;: &lt;code&gt;default-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'; script-src 'self'&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add&lt;/strong&gt;: only the missing sources, directive by directive (each directive is one instruction such as &lt;code&gt;script-src&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Replace&lt;/strong&gt;: scripts written directly in the HTML with a nonce or a hash&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test&lt;/strong&gt;: run &lt;code&gt;Content-Security-Policy-Report-Only&lt;/code&gt; for a week&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enforce&lt;/strong&gt;: if nothing breaks, rename the header to &lt;code&gt;Content-Security-Policy&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Where you set this depends on your hosting. The official steps are here.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP" rel="noopener noreferrer"&gt;MDN's official Content-Security-Policy documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://csp-evaluator.withgoogle.com/" rel="noopener noreferrer"&gt;Google's CSP Evaluator (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://web.dev/articles/csp" rel="noopener noreferrer"&gt;web.dev's official CSP documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.cloudflare.com/pages/configuration/headers/" rel="noopener noreferrer"&gt;Cloudflare Pages' official Headers documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.cloudflare.com/rules/transform/" rel="noopener noreferrer"&gt;Cloudflare's official Transform Rules documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.netlify.com/manage/routing/headers/" rel="noopener noreferrer"&gt;Netlify's official Headers documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vercel.com/docs/project-configuration#headers" rel="noopener noreferrer"&gt;Vercel's official Headers documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nextjs.org/docs/app/guides/content-security-policy" rel="noopener noreferrer"&gt;Next.js's official Content Security Policy documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On Netlify and Cloudflare Pages, you put a &lt;code&gt;_headers&lt;/code&gt; file in the publish directory and list a path such as &lt;code&gt;/*&lt;/code&gt; with the headers. On Vercel, you write them under &lt;code&gt;headers&lt;/code&gt; in &lt;code&gt;vercel.json&lt;/code&gt;. Next.js documents how to issue a nonce in middleware (code that runs before the response is sent).&lt;/p&gt;

&lt;p&gt;If you want to add the header at Cloudflare's proxy instead, you can do it with a Transform Rule ("Modify response header"). Decide which side owns the header first, so the app and the proxy do not both add it.&lt;/p&gt;

&lt;p&gt;If you already followed &lt;a href="https://ismyappok.com/en/articles/security-headers?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=csp-basics" rel="noopener noreferrer"&gt;Security headers, explained&lt;/a&gt;, this is one more line in the same place.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it looks in the result screen
&lt;/h2&gt;

&lt;p&gt;"3. Result" in vuln shows a pass-rate summary and the checklist. The table has six columns: ID, Item, Priority, Result, Area, and Evidence and fix.&lt;/p&gt;

&lt;p&gt;V02 and V03 both appear in the Headers area. The Evidence and fix column keeps what was observed as &lt;code&gt;key=value&lt;/code&gt; lines. With no CSP you see &lt;code&gt;request=GET …&lt;/code&gt; and &lt;code&gt;header=content-security-policy&lt;/code&gt;. The column alone does not tell you whether the policy was report-only.&lt;/p&gt;

&lt;p&gt;The "Needs work only" filter includes "Check" as well. Combined with the priority sort, it helps you fix V02 and then V03.&lt;/p&gt;

&lt;h2&gt;
  
  
  What CSP does not prevent
&lt;/h2&gt;

&lt;p&gt;vuln is not a penetration test. It checks the public face of a site from the outside.&lt;/p&gt;

&lt;p&gt;CSP stops a script that got onto the page from running. It does not fix the reason the script got there (input validation and escaping). It does not look at server-side holes, broken authentication, or vulnerable dependencies (holes in how the site is built that can be attacked) either.&lt;/p&gt;

&lt;p&gt;"CSP means XSS cannot happen" is wrong. The right way to put it is that CSP makes the damage smaller when an XSS does happen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finding nothing does not mean the site is safe.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;CSP is not "block everything"; it is "only the people on the list get in". Aiming for perfect on day one breaks sites. Starting from &lt;code&gt;default-src 'self'&lt;/code&gt; and adding sources while checking with Report-Only seems like the realistic path.&lt;/p&gt;

&lt;p&gt;Start with V02 in vuln. If there is no CSP, V02 says "Needs work". If V02 passes, look at V03 for weaknesses inside the policy.&lt;/p&gt;

&lt;p&gt;The fixes are collected on these pages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ismyappok.com/en/checks/csp?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=csp-basics" rel="noopener noreferrer"&gt;Content-Security-Policy (CSP)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ismyappok.com/en/checks/security-headers?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=csp-basics" rel="noopener noreferrer"&gt;Other security headers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ismyappok.com/en/checks/clickjacking?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=csp-basics" rel="noopener noreferrer"&gt;Clickjacking protection&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you have changed the settings, &lt;a href="https://ismyappok.com/en/vuln?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=csp-basics" rel="noopener noreferrer"&gt;run vuln&lt;/a&gt; again. You can check display and links before launch with &lt;a href="https://ismyappok.com/en/audit?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=csp-basics" rel="noopener noreferrer"&gt;audit (no login)&lt;/a&gt; as well.&lt;/p&gt;

&lt;p&gt;This article is based on checking our own site's settings. We did not scan anyone else's site for it. The numbers are recommended values and implementation thresholds; the only measurements are the ones with the date and method given in the text.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>html</category>
      <category>security</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why you should not stay on http:// (HSTS and always-on HTTPS)</title>
      <dc:creator>Masahiro Kurokawa</dc:creator>
      <pubDate>Thu, 26 Nov 2026 01:59:07 +0000</pubDate>
      <link>https://dev.to/masahirokurokawa/why-you-should-not-stay-on-http-hsts-and-always-on-https-5e74</link>
      <guid>https://dev.to/masahirokurokawa/why-you-should-not-stay-on-http-hsts-and-always-on-https-5e74</guid>
      <description>&lt;p&gt;Has your browser ever said "Not secure" in the address bar? If it says that when you open the site you published, the front door has no lock on it.&lt;/p&gt;

&lt;p&gt;The short version: there are three things to do. Serve the site over HTTPS. Send anyone who arrives on http:// to https://. Send HSTS. Only when all three are in place do you have always-on HTTPS.&lt;/p&gt;

&lt;h2&gt;
  
  
  The difference between http and https
&lt;/h2&gt;

&lt;p&gt;Think of a postcard versus an envelope. With http, both the address and the contents are on an open postcard, and anyone at any post office along the way can read it.&lt;/p&gt;

&lt;p&gt;https is the version that travels in an envelope. The contents are wrapped in TLS (the way the connection is encrypted), so they cannot be read or changed in transit. The padlock in the address bar is the sign that the envelope is in use.&lt;/p&gt;

&lt;p&gt;You may think this has nothing to do with you. It matters if your site has a form, a login, or a payment. It is the difference between the words people type there being readable on the way or not.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the padlock disappears
&lt;/h2&gt;

&lt;p&gt;When an https page loads an http image or script, the browser treats it as mixed content. It shows a warning, or blocks the load outright.&lt;/p&gt;

&lt;p&gt;The result can be that the padlock disappears even though the page itself is served over https. One http image is often all it takes.&lt;/p&gt;

&lt;p&gt;The fixes are collected in &lt;a href="https://ismyappok.com/en/checks/mixed-content?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=hsts-and-http" rel="noopener noreferrer"&gt;Mixed content&lt;/a&gt;. The place to start is swapping each http part for the same part over https.&lt;/p&gt;

&lt;h2&gt;
  
  
  What HSTS is
&lt;/h2&gt;

&lt;p&gt;HSTS is a notice taped to a shop door that says "from now on, please always use this door". Once a visitor has come in, they remember the notice.&lt;/p&gt;

&lt;p&gt;HSTS (Strict-Transport-Security) is one of the headers a server sends with its response. It tells the browser to use HTTPS only from the next visit on.&lt;/p&gt;

&lt;p&gt;Once a browser has opened the site over HTTPS, it remembers that instruction for the max-age period. During that time, even if someone follows an http:// link, the browser switches to https:// by itself.&lt;/p&gt;

&lt;p&gt;A common target is &lt;code&gt;max-age=31536000; includeSubDomains&lt;/code&gt;. 31536000 seconds is one year. includeSubDomains extends the same instruction to your subdomains.&lt;/p&gt;

&lt;p&gt;Two cautions. HSTS is only accepted over an HTTPS response, so it cannot protect the very first request over http. That is why it goes together with a redirect. And add includeSubDomains only after you have confirmed that every subdomain works over HTTPS.&lt;/p&gt;

&lt;p&gt;preload teaches browsers from the start that a domain is HTTPS only. It is powerful, but removing a domain from the list takes time, so treat it as the final step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Always-on HTTPS has two parts
&lt;/h2&gt;

&lt;p&gt;The first part is the redirect. A request that arrives on http:// is sent back to the same path on https:// with a 301 or 308. Keep the path and the query string (everything after the &lt;code&gt;?&lt;/code&gt;) so that old links still land in the right place.&lt;/p&gt;

&lt;p&gt;The second part is HSTS. With a redirect alone, following an http:// link still goes through the entrance once. With HSTS, the browser picks https:// from the start on later visits.&lt;/p&gt;

&lt;p&gt;The order matters. Fix the redirect first, confirm it works, and then add HSTS.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two items vuln checks
&lt;/h2&gt;

&lt;p&gt;vuln (&lt;a href="https://ismyappok.com/en/vuln?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=hsts-and-http" rel="noopener noreferrer"&gt;a free check that runs on a public URL&lt;/a&gt;) shows this in its result table as two rows.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;V01 HTTPS / HSTS (area: Headers, priority 3)&lt;/li&gt;
&lt;li&gt;V13 HTTP to HTTPS (area: Transport, priority 3)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;V01 looks at whether the top page's response carries HSTS. If it is missing, or if max-age is below 180 days (15552000 seconds), the result is "Check". A missing includeSubDomains also shows as "Check".&lt;/p&gt;

&lt;p&gt;V13 sends a HEAD request to the http:// version and looks at how it answers. A 200 with content means "Needs work"; a redirect to https means "Pass"; a redirect somewhere other than https means "Needs work".&lt;/p&gt;

&lt;p&gt;The vuln input accepts https URLs only, but vuln makes the http:// request itself. You do not need to change the URL you enter.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to fix it
&lt;/h2&gt;

&lt;p&gt;The order is: redirect, then HSTS, then includeSubDomains, then preload.&lt;/p&gt;

&lt;p&gt;Start by finding the redirect setting in your hosting. Cloudflare, Netlify, and Vercel all have one. The official steps are here.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developers.cloudflare.com/ssl/edge-certificates/additional-options/always-use-https/" rel="noopener noreferrer"&gt;Cloudflare's official Always Use HTTPS documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.netlify.com/manage/domains/secure-domains-with-https/https-ssl/" rel="noopener noreferrer"&gt;Netlify's official HTTPS (SSL) documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vercel.com/docs/security/encryption" rel="noopener noreferrer"&gt;Vercel's official Encryption (TLS) documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security" rel="noopener noreferrer"&gt;MDN's official Strict-Transport-Security documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On Cloudflare, turning on "Always Use HTTPS" sends http requests to https. Netlify has an HTTPS setting per domain, and Vercel sends HSTS even on custom domains. Check what your own service currently has set.&lt;/p&gt;

&lt;p&gt;You can also write the redirect in your framework. But stacking it on top of the hosting setting can double the redirect or send people to a URL you did not intend. Look at the hosting first, and add the app-side rule only when something is missing.&lt;/p&gt;

&lt;p&gt;Once the redirect works, add HSTS. In your hosting or framework settings, add &lt;code&gt;Strict-Transport-Security: max-age=31536000; includeSubDomains&lt;/code&gt; to the response headers. The general routine for headers is also covered in &lt;a href="https://ismyappok.com/en/articles/security-headers?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=hsts-and-http" rel="noopener noreferrer"&gt;Security headers, explained&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can also raise the HSTS period in steps. Start with a short max-age, confirm nothing breaks, and then move to one year. Setting a long period straight away makes it harder to roll back a mistake.&lt;/p&gt;

&lt;h2&gt;
  
  
  A measurement from our own site
&lt;/h2&gt;

&lt;p&gt;On 21 November 2026 we checked this site's response headers with &lt;code&gt;curl -sSI&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://ismyappok.com" rel="noopener noreferrer"&gt;https://ismyappok.com&lt;/a&gt; returns &lt;code&gt;strict-transport-security: max-age=31536000; includeSubDomains&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://ismyappok.com/ja/articles" rel="noopener noreferrer"&gt;http://ismyappok.com/ja/articles&lt;/a&gt; returns 308 with &lt;code&gt;location: https://ismyappok.com/ja/articles&lt;/code&gt;, so it redirects to https&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://ismyappok.com/ja/articles?x=1" rel="noopener noreferrer"&gt;http://ismyappok.com/ja/articles?x=1&lt;/a&gt; returns 308 with &lt;code&gt;location: https://ismyappok.com/ja/articles?x=1&lt;/code&gt;, keeping the query&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So HSTS is in place and the http entrance now closes by redirecting to https. In vuln terms, both V01 and V13 are a pass.&lt;/p&gt;

&lt;p&gt;Update (21 November 2026): when this article was published, http returned 200 and V13 was "Needs work". We then added a permanent redirect (308) in the app for requests that arrive over http, keeping the same path and query, and shipped it. The measurement above is from the same day, after that change.&lt;/p&gt;

&lt;p&gt;Writing this made me realise that checking your own site is part of the job. Open both https and http and see whether the same page comes back. If it does, the redirect is still missing.&lt;/p&gt;

&lt;p&gt;This check reads the response from the CDN (the network that serves the site from many locations). It may differ from the origin server's settings, so treat the result as a snapshot of that moment.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it looks in the result screen
&lt;/h2&gt;

&lt;p&gt;"3. Result" in vuln shows a pass-rate summary and the checklist. The table has six columns: ID, Item, Priority, Result, Area, and Evidence and fix.&lt;/p&gt;

&lt;p&gt;V01 appears in the Headers area and V13 in the Transport area. Results are one of "Pass", "Check", "Needs work", or "Not checked".&lt;/p&gt;

&lt;p&gt;The Evidence and fix column keeps what the check observed as &lt;code&gt;key=value&lt;/code&gt; lines. For V01 that is &lt;code&gt;header=strict-transport-security&lt;/code&gt; and &lt;code&gt;excerpt=max-age=…&lt;/code&gt;; for V13 it is &lt;code&gt;request=HEAD http://…&lt;/code&gt; and &lt;code&gt;status=200&lt;/code&gt;. A &lt;code&gt;status=200&lt;/code&gt; means "http returned content", which is your cue to look at the redirect.&lt;/p&gt;

&lt;p&gt;The Priority column and the "Needs work only" filter help you decide what to fix first. The filter includes "Check" as well as "Needs work", because both are candidates.&lt;/p&gt;

&lt;h2&gt;
  
  
  HTTPS alone does not make a site safe
&lt;/h2&gt;

&lt;p&gt;vuln is not a penetration test. It checks the public face of a site from the outside.&lt;/p&gt;

&lt;p&gt;It does not look inside the certificate, behind a login, at APIs, or at business logic. HSTS does not close the hole that lets a script into the page, either.&lt;/p&gt;

&lt;p&gt;It can also be wrong in the other direction. The check observes from the edge, so what it sees may differ from the origin server. Run the check again after you make changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finding nothing does not mean the site is safe.&lt;/strong&gt; That holds for every check.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Publishing over http:// leaves the first visit exposed. The fix is two parts: the redirect and HSTS. Both often take a few lines in a config file, which is a decent return for the effort.&lt;/p&gt;

&lt;p&gt;Start with V13 and V01 in vuln. If V13 says "Needs work", it is the redirect; if V01 says "Check", it is HSTS.&lt;/p&gt;

&lt;p&gt;The fixes are collected on these pages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ismyappok.com/en/checks/hsts?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=hsts-and-http" rel="noopener noreferrer"&gt;HTTPS and HSTS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ismyappok.com/en/checks/http-to-https?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=hsts-and-http" rel="noopener noreferrer"&gt;HTTP to HTTPS redirect&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ismyappok.com/en/checks/mixed-content?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=hsts-and-http" rel="noopener noreferrer"&gt;Mixed content&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ismyappok.com/en/checks/security-headers?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=hsts-and-http" rel="noopener noreferrer"&gt;Other security headers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you have changed the settings, &lt;a href="https://ismyappok.com/en/vuln?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=hsts-and-http" rel="noopener noreferrer"&gt;run vuln&lt;/a&gt; again. You can check display and links before launch with &lt;a href="https://ismyappok.com/en/audit?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=hsts-and-http" rel="noopener noreferrer"&gt;audit (no login)&lt;/a&gt; as well.&lt;/p&gt;

&lt;p&gt;This article is based on checking our own site's settings. We did not scan anyone else's site for it. The numbers are recommended values and implementation thresholds; the only measurements are the ones with the date and method given in the text.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>networking</category>
      <category>security</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Security headers, explained: the six a scan flags and how to fix them</title>
      <dc:creator>Masahiro Kurokawa</dc:creator>
      <pubDate>Wed, 25 Nov 2026 07:11:28 +0000</pubDate>
      <link>https://dev.to/masahirokurokawa/security-headers-explained-the-six-a-scan-flags-and-how-to-fix-them-jbc</link>
      <guid>https://dev.to/masahirokurokawa/security-headers-explained-the-six-a-scan-flags-and-how-to-fix-them-jbc</guid>
      <description>&lt;p&gt;You publish your site, run vuln (&lt;a href="https://ismyappok.com/en/vuln?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=security-headers" rel="noopener noreferrer"&gt;a free check that runs on a public URL&lt;/a&gt;), and the header rows in the result table have "Needs work" or "Check" against them. "Other security headers" is the confusing one: the name alone does not tell you what is missing. Many people stop right there and ask what a header even is.&lt;/p&gt;

&lt;p&gt;The short version: a security header is a &lt;strong&gt;request the server sends to the browser&lt;/strong&gt; along with the page. You do not have to memorise all six. Add the ones vuln points at. The place to change them is usually your hosting settings or your framework's configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a security header is
&lt;/h2&gt;

&lt;p&gt;Like a notice taped to a shop door, a site hands the person who opens it a short note every time, before anything else happens. That note is the security header.&lt;/p&gt;

&lt;p&gt;A header (an HTTP header) is a line the server sends with the page. Some of them tell the browser what the page is allowed to do. Those are the security headers.&lt;/p&gt;

&lt;p&gt;By default, the browser leans towards allowing what it has not been told about. Unless the person who built the site writes down "do not load this", the instruction is simply not there.&lt;/p&gt;

&lt;p&gt;The people who lose out when it is missing are the visitors who open your site. When they get fooled, it is the site's trust that drops. If you publish your own app, treat this note as part of your own setup.&lt;/p&gt;

&lt;p&gt;They are not written in the HTML. They arrive with the response. The browser reads them before it shows the page and refuses things that are not allowed.&lt;/p&gt;

&lt;p&gt;CSP can also be set with a meta tag in the HTML (Referrer-Policy works in meta too). But frame-ancestors, the directive that blocks embedding, does not work in meta. vuln does not use meta for its embedding check either. Setting the header is the normal route.&lt;/p&gt;

&lt;h2&gt;
  
  
  The six headers vuln looks at
&lt;/h2&gt;

&lt;p&gt;vuln reads these headers from the top page's response. They do not all carry the same weight, and a missing one is treated differently depending on which it is. Here is the whole picture first.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Content-Security-Policy (CSP)&lt;/strong&gt;: limits where scripts, styles, and frames may be loaded from. Without it, a script that gets into the page does more damage. A common target is &lt;code&gt;default-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'&lt;/code&gt;. In vuln, missing means "Needs work"; a weak policy is a separate item.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strict-Transport-Security (HSTS)&lt;/strong&gt;: makes the browser use HTTPS only for that domain from the next visit on. Without it, public Wi-Fi can still send someone to HTTP. A common target is &lt;code&gt;max-age=31536000; includeSubDomains&lt;/code&gt;. In vuln, a missing or short value shows as "Check".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;X-Content-Type-Options&lt;/strong&gt;: stops the browser from guessing a file's type from its contents. Without it, the browser has more room to treat a file as the wrong type. The usual value is &lt;code&gt;nosniff&lt;/code&gt;. It counts as part of "Other security headers" and shows as "Check".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;X-Frame-Options / frame-ancestors&lt;/strong&gt;: stops other sites from embedding your page in a frame (iframe). Without it, an invisible button can be laid over your page to steer clicks (clickjacking). Use &lt;code&gt;X-Frame-Options: DENY&lt;/code&gt; or &lt;code&gt;frame-ancestors 'none'&lt;/code&gt;. In vuln, missing means "Needs work".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Referrer-Policy&lt;/strong&gt;: decides how much of the "where you came from" information is passed on when someone follows a link. Without it, the path and query of your URL are more likely to reach another site. A common target is &lt;code&gt;strict-origin-when-cross-origin&lt;/code&gt;. It counts as part of "Other security headers" and shows as "Check".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permissions-Policy&lt;/strong&gt;: decides whether the page may use features such as the camera, microphone, or location. Without it, permissions for features you do not need stay available. A common target is &lt;code&gt;camera=(), microphone=(), geolocation=()&lt;/code&gt;. vuln treats it as a reference item and does not flag it on its own.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each one is explained below.&lt;/p&gt;

&lt;h3&gt;
  
  
  Content-Security-Policy (CSP)
&lt;/h3&gt;

&lt;p&gt;This header limits where scripts, styles, and frames may be loaded from. Think of it as the approved supplier list for the parts your page borrows from elsewhere; that may be an easier way to picture it.&lt;/p&gt;

&lt;p&gt;Without it, if a malicious script gets into the page, the browser has fewer limits on what it can do. vuln treats a missing CSP as needs work. It also has a separate item for weaknesses such as &lt;code&gt;'unsafe-inline'&lt;/code&gt;, &lt;code&gt;'unsafe-eval'&lt;/code&gt;, or &lt;code&gt;*&lt;/code&gt; in the policy.&lt;/p&gt;

&lt;p&gt;A first step looks like &lt;code&gt;default-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'&lt;/code&gt;. If you use third-party analytics or fonts, this will block some of them.&lt;/p&gt;

&lt;p&gt;So do not enforce it straight away. Start with a &lt;code&gt;Content-Security-Policy-Report-Only&lt;/code&gt; header instead. Report-Only only records violations; it does not block anything. The browser console, or the report endpoint you name, fills up with the loads that would have been blocked. Watch it for a week or two, and once nothing unexpected shows up, switch the same value to &lt;code&gt;Content-Security-Policy&lt;/code&gt; to enforce it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Strict-Transport-Security (HSTS)
&lt;/h3&gt;

&lt;p&gt;This header makes the browser use HTTPS only for that domain from the next visit on.&lt;/p&gt;

&lt;p&gt;Without it, a public Wi-Fi network can still send someone to http://, where the connection can be read or changed. The site looks normal to the visitor, so they never notice.&lt;/p&gt;

&lt;p&gt;HSTS is only accepted over an HTTPS response. It cannot protect the very first request over HTTP, so it is not a complete fix on its own.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;max-age=31536000; includeSubDomains&lt;/code&gt; is the usual target (one year). Add includeSubDomains only after you have confirmed that every subdomain works over HTTPS. vuln flags a max-age below six months (15552000 seconds).&lt;/p&gt;

&lt;h3&gt;
  
  
  X-Content-Type-Options
&lt;/h3&gt;

&lt;p&gt;Send this with the value &lt;code&gt;nosniff&lt;/code&gt;. It stops the browser from guessing a file's type from its contents.&lt;/p&gt;

&lt;p&gt;Without it, the browser has more room to treat a file as a different type than you intended. The impact depends on the page, so vuln treats it as a lower-priority (check) item.&lt;/p&gt;

&lt;h3&gt;
  
  
  X-Frame-Options / frame-ancestors
&lt;/h3&gt;

&lt;p&gt;This setting stops other sites from embedding your page in a frame (iframe).&lt;/p&gt;

&lt;p&gt;Without it, another site can place an invisible button over your page and make visitors click something they did not intend (clickjacking). Login, payment, and settings screens are the most exposed.&lt;/p&gt;

&lt;p&gt;Either &lt;code&gt;X-Frame-Options: DENY&lt;/code&gt; or CSP &lt;code&gt;frame-ancestors 'none'&lt;/code&gt; is enough. Having both does not trigger a finding. If a partner needs to embed you, allow only that partner. vuln does not look at the value itself, such as &lt;code&gt;DENY&lt;/code&gt; or &lt;code&gt;SAMEORIGIN&lt;/code&gt;; it only checks whether the header is there.&lt;/p&gt;

&lt;h3&gt;
  
  
  Referrer-Policy
&lt;/h3&gt;

&lt;p&gt;This header decides how much of the 'where you came from' information (the Referer header) is passed on when someone follows a link.&lt;/p&gt;

&lt;p&gt;Without it, the destination is more likely to receive the path and query of your URL. In general, that can leak internal URLs or search terms to another site.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;strict-origin-when-cross-origin&lt;/code&gt; is the usual target. Other sites see only the domain; within your own site, more detail is kept.&lt;/p&gt;

&lt;h3&gt;
  
  
  Permissions-Policy
&lt;/h3&gt;

&lt;p&gt;This header decides whether the page may use features such as the camera, microphone, or location.&lt;/p&gt;

&lt;p&gt;Without it, permissions for features you do not need stay available to the page. vuln treats this as a reference (info) item, not a vulnerability on its own.&lt;/p&gt;

&lt;p&gt;Turn off what you do not use, for example &lt;code&gt;camera=(), microphone=(), geolocation=()&lt;/code&gt;. Do not disable a feature the site actually uses. This one depends on what your site does.&lt;/p&gt;

&lt;p&gt;One more note: the "Other security headers" item also looks at Cross-Origin-Opener-Policy (COOP) and Cross-Origin-Resource-Policy (CORP) as reference items. They separate your page from other origins (a different domain, port, or scheme), and missing them is not a vulnerability by itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  What can happen without them
&lt;/h2&gt;

&lt;p&gt;Header advice tends to turn into attack talk, so here are just three things in everyday terms.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Injection: a script can slip into your page through an input field or comment box. CSP narrows how far the damage spreads after that happens.&lt;/li&gt;
&lt;li&gt;Impersonation: a public Wi-Fi network can send someone to a look-alike http:// page. HSTS reduces that room from the next visit on.&lt;/li&gt;
&lt;li&gt;Embedding: another site can lay your page underneath an invisible button and steer clicks. frame-ancestors stops it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these means 'you are in danger right now' just because a header is missing. Think of it as removing one gap at a time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to fix them
&lt;/h2&gt;

&lt;p&gt;You do not change the HTML. You change the side that sends the response. There are three common entry points.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hosting settings: Netlify and Cloudflare Pages use a &lt;code&gt;_headers&lt;/code&gt; file, and Vercel uses &lt;code&gt;headers&lt;/code&gt; in its config.&lt;/li&gt;
&lt;li&gt;Framework settings: frameworks such as Next.js and Nuxt can add headers for every page in one place. For Next.js, the headers config is the entry point; for Nuxt, it is routeRules. Nuxt also has a Nuxt Security module as a helper. This depends on how your site is built, so check the docs for your setup.&lt;/li&gt;
&lt;li&gt;A CDN (a network that serves your site from many locations) or reverse proxy such as Cloudflare: these can sometimes rewrite response headers. What is available depends on your plan and setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The official instructions for hosting and frameworks are here.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.netlify.com/routing/headers/" rel="noopener noreferrer"&gt;Netlify's official Headers documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.cloudflare.com/pages/configuration/headers/" rel="noopener noreferrer"&gt;Cloudflare Pages' official Headers documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vercel.com/docs/headers" rel="noopener noreferrer"&gt;Vercel's official Headers documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nextjs.org/docs/app/api-reference/config/next-config-js/headers" rel="noopener noreferrer"&gt;the official Next.js headers config documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nuxt.com/docs/api/nuxt-config#routerules" rel="noopener noreferrer"&gt;the official Nuxt routeRules documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nuxt.com/modules/security" rel="noopener noreferrer"&gt;the official Nuxt Security module page (English)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This site does the same thing with its Worker's response headers. The values include &lt;code&gt;Strict-Transport-Security: max-age=31536000; includeSubDomains&lt;/code&gt;, &lt;code&gt;X-Content-Type-Options: nosniff&lt;/code&gt;, &lt;code&gt;Referrer-Policy: strict-origin-when-cross-origin&lt;/code&gt;, and &lt;code&gt;Permissions-Policy: camera=(), microphone=(), geolocation=()&lt;/code&gt;. The CSP uses a nonce (a one-off string made fresh for each request) and includes &lt;code&gt;frame-ancestors 'none'&lt;/code&gt;. A few pages that show an ad gate use a different CSP, because of how ads are served.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fixing it without writing code (Lovable, Bolt, and similar)
&lt;/h3&gt;

&lt;p&gt;If you build with a chat-driven tool such as Lovable or Bolt, you rarely open a config file yourself. How the tools work and where the settings live are on their official pages.&lt;/p&gt;

&lt;p&gt;The official pages are here.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.lovable.dev/" rel="noopener noreferrer"&gt;Lovable's official documentation (English)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://support.bolt.new/" rel="noopener noreferrer"&gt;Bolt's official support site (English)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The vuln result screen can hand you text to paste straight into that chat.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the result table, press the "Prompt" button on the row you want to fix. When several items need work, "All prompts" below the table collects them in one go.&lt;/li&gt;
&lt;li&gt;Press "Copy" in the text that opens. "Copied" means it worked.&lt;/li&gt;
&lt;li&gt;Paste it into the Lovable or Bolt chat and ask for the settings change.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The text carries the URL, the item, the result, the impact, the fix, and the evidence the scan observed. If that does not get through, a short request like this also works:&lt;/p&gt;

&lt;p&gt;"In the vuln scan, 'Other security headers' came back as Check. Please add X-Content-Type-Options: nosniff and Referrer-Policy: strict-origin-when-cross-origin to the response headers of every page. Show me the file to change and the result after the change."&lt;/p&gt;

&lt;p&gt;Three things to watch for when you set them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do not send the same header twice. Setting it in both the host and the framework can produce a value you did not intend.&lt;/li&gt;
&lt;li&gt;CSP breaks pages easily. While it is Report-Only, vuln still counts it as "no CSP", because it is not enforced.&lt;/li&gt;
&lt;li&gt;Add HSTS includeSubDomains only after every subdomain is on HTTPS.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How it shows up in the result screen
&lt;/h2&gt;

&lt;p&gt;Step 3 of vuln shows a summary of the pass rate and a table of checked items. The table has six columns: ID, item, priority, result, area, and evidence and fix (the last column holds both the evidence and the fix).&lt;/p&gt;

&lt;p&gt;Seven rows have the area "headers".&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;V01 HTTPS / HSTS&lt;/li&gt;
&lt;li&gt;V02 CSP present&lt;/li&gt;
&lt;li&gt;V03 CSP weaknesses&lt;/li&gt;
&lt;li&gt;V04 Clickjacking&lt;/li&gt;
&lt;li&gt;V05 Other security headers&lt;/li&gt;
&lt;li&gt;V14 CORS (reference)&lt;/li&gt;
&lt;li&gt;V17 Cache settings (reference)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last two are reference items. The six headers in this article show up in the five rows V01 to V05.&lt;/p&gt;

&lt;p&gt;Each result is "Pass", "Check", "Needs work", or "Not checked". A missing CSP or missing embedding protection shows as "Needs work"; a missing HSTS or other header shows as "Check". The priority column and the "Needs work only" filter help you decide what to do first. That filter includes "Check" as well as "Needs work", because both are candidates to fix.&lt;/p&gt;

&lt;p&gt;The evidence and fix column keeps what the scan observed as &lt;code&gt;key=value&lt;/code&gt;. &lt;code&gt;header=x-frame-options&lt;/code&gt; means "this header was looked at", &lt;code&gt;request=GET https://...&lt;/code&gt; means "this request's response was read", and &lt;code&gt;excerpt=...&lt;/code&gt; means "this part of the response header was read". Read the evidence rather than going by the row alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Headers alone do not make a site safe
&lt;/h2&gt;

&lt;p&gt;vuln is not a penetration test. It checks the public face of a site from the outside.&lt;/p&gt;

&lt;p&gt;Plenty is out of scope: JavaScript that loads late, pages behind a login, APIs, business logic, the finer points of TLS (how the connection is encrypted), and known vulnerabilities (CVEs). What vuln actually fetches is this.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The top page, following redirects.&lt;/li&gt;
&lt;li&gt;Up to two same-origin JavaScript files found on that page, and up to one source map (the file that maps built code back to the original).&lt;/li&gt;
&lt;li&gt;The fixed paths &lt;code&gt;/.env&lt;/code&gt;, &lt;code&gt;/.git/config&lt;/code&gt;, and &lt;code&gt;/.env.production&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;One HEAD request to the &lt;code&gt;http://&lt;/code&gt; version, to see whether it redirects to HTTPS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It does not look at the top page only; it walks this fixed set in the same order every time. Even so, it does not cover the whole site.&lt;/p&gt;

&lt;p&gt;It can also be wrong in the other direction. The check observes from the edge (CDN), so what it sees may differ from the origin server's settings. A result is a snapshot of that moment. Run the check again after you make changes.&lt;/p&gt;

&lt;p&gt;And a header only &lt;strong&gt;reduces the damage&lt;/strong&gt;. It does not close the hole that lets something in. &lt;strong&gt;Finding nothing does not mean the site is safe.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Six headers sounds like a lot, but you do not need all of them perfect on day one. Start with whatever shows as "Needs work" and take them one at a time. Headers are dull, but they often take a few lines in a config file, which is a decent return for the effort.&lt;/p&gt;

&lt;p&gt;For the order, start with CSP and embedding protection (both "Needs work"). They matter most, and they often take only a few lines. Then HSTS, and finally "Other security headers".&lt;/p&gt;

&lt;p&gt;The fixes are collected on these pages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://ismyappok.com/en/checks/security-headers?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=security-headers" rel="noopener noreferrer"&gt;Other security headers&lt;/a&gt;: X-Content-Type-Options, Referrer-Policy, Permissions-Policy, COOP/CORP&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ismyappok.com/en/checks/csp?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=security-headers" rel="noopener noreferrer"&gt;Content-Security-Policy (CSP)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ismyappok.com/en/checks/hsts?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=security-headers" rel="noopener noreferrer"&gt;HTTPS and HSTS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ismyappok.com/en/checks/clickjacking?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=security-headers" rel="noopener noreferrer"&gt;Clickjacking protection&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you have changed the settings, &lt;a href="https://ismyappok.com/en/vuln?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=security-headers" rel="noopener noreferrer"&gt;run vuln&lt;/a&gt; again. Besides headers, vuln also looks at cookie attributes and exposed secrets. For the public settings, &lt;a href="https://ismyappok.com/en/audit?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=security-headers" rel="noopener noreferrer"&gt;audit&lt;/a&gt; can check display and links too, but audit does not check headers.&lt;/p&gt;

&lt;p&gt;This article is based on checking our own site's settings. We did not scan anyone else's site for it. The numbers are recommended values and implementation thresholds, not measurements.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>security</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Running vuln on a Lovable app: where to put the verification token</title>
      <dc:creator>Masahiro Kurokawa</dc:creator>
      <pubDate>Tue, 24 Nov 2026 02:41:47 +0000</pubDate>
      <link>https://dev.to/masahirokurokawa/running-vuln-on-a-lovable-app-where-to-put-the-verification-token-2alp</link>
      <guid>https://dev.to/masahirokurokawa/running-vuln-on-a-lovable-app-where-to-put-the-verification-token-2alp</guid>
      <description>&lt;p&gt;You open vuln (&lt;a href="https://ismyappok.com/en/vuln?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=lovable-vuln-token" rel="noopener noreferrer"&gt;a free check that runs on a public URL&lt;/a&gt;), paste your URL, and the first thing it asks is whether the site is really yours. That is where most people stall.&lt;/p&gt;

&lt;p&gt;The short version: you publish one file. It works on a Lovable app too. We ran the whole flow on 13 November 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why verification is required
&lt;/h2&gt;

&lt;p&gt;vuln inspects the settings of a public URL from the outside. That includes exposed secrets and missing security headers. For the second one, see &lt;a href="https://ismyappok.com/en/checks/security-headers?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=lovable-vuln-token" rel="noopener noreferrer"&gt;Other security headers&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If anyone could scan any site, the results would become material for attacks. So vuln only scans hosts where you can prove you control the domain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two ways to verify, and Lovable allows only one
&lt;/h2&gt;

&lt;p&gt;There are two ways to verify: DNS TXT and a well-known file. On a shared subdomain such as &lt;code&gt;*.lovable.app&lt;/code&gt;, DNS TXT is not available, because the platform manages the DNS records, not the app owner.&lt;/p&gt;

&lt;p&gt;So on a Lovable app, the well-known file is the only option. The screen says the same thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Paste the target URL into vuln&lt;/li&gt;
&lt;li&gt;Copy the token it shows (for example &lt;code&gt;ismyappok-vuln=abc123...&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;In the Lovable chat, create &lt;code&gt;public/.well-known/ismyappok-vuln.txt&lt;/code&gt; with that single line as its contents&lt;/li&gt;
&lt;li&gt;Publish, then press "verify" in vuln&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A request to Lovable can be as short as this.&lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;public/.well-known/ismyappok-vuln.txt&lt;/code&gt; with this single line:&lt;br&gt;
&lt;code&gt;ismyappok-vuln=abc123...&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxldeys0wwb9srg2quj4v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxldeys0wwb9srg2quj4v.png" alt="Lovable chat showing a request to create the well-known file" width="800" height="1554"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu93wj062z3ytdn6ndcwp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu93wj062z3ytdn6ndcwp.png" alt="Lovable chat replying that the file was added" width="800" height="1563"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened when we placed it
&lt;/h2&gt;

&lt;p&gt;On 13 November 2026 we placed the file in a Lovable app with the same steps and checked it with &lt;code&gt;curl&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Status: 200 (no redirect)&lt;/li&gt;
&lt;li&gt;Content-Type: &lt;code&gt;text/plain; charset=utf-8&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Body: exactly the line we placed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;vuln requires three things: the file returns 200 directly, its content type is not text/html, and the body contains the token line. Ours met all three.&lt;/p&gt;

&lt;h2&gt;
  
  
  When it does not work
&lt;/h2&gt;

&lt;h3&gt;
  
  
  You get a 404
&lt;/h3&gt;

&lt;p&gt;The file is not part of the published site. Check that it sits under &lt;code&gt;public/.well-known/&lt;/code&gt; and that you have published. In the app we tested, paths that do not exist returned 404 (no page came back), so a 404 means the file is not there.&lt;/p&gt;

&lt;h3&gt;
  
  
  You get text/html
&lt;/h3&gt;

&lt;p&gt;The site is answering with a page for a path that does not exist. Check the spelling of the file name (&lt;code&gt;ismyappok-vuln.txt&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  Verification fails right after publishing
&lt;/h3&gt;

&lt;p&gt;A publish can take a little time to go live. Wait about a minute and press verify again.&lt;/p&gt;

&lt;h3&gt;
  
  
  A preview URL cannot be verified
&lt;/h3&gt;

&lt;p&gt;A preview URL such as &lt;code&gt;id-preview-...lovable.app&lt;/code&gt; from the Lovable editor cannot be read from the outside. Ours returned 401. Verify against the published URL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm8d96ctcah7zjhbp490q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm8d96ctcah7zjhbp490q.png" alt="vuln verification failing against a Lovable preview URL" width="800" height="719"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The token is tied to the host. A token issued for another host will not match, so if you change the URL, copy the token the screen shows for that host.&lt;/p&gt;

&lt;p&gt;Changes in Lovable also go into a draft. Unless you accept the change and publish, it will not reach the live site.&lt;/p&gt;

&lt;h3&gt;
  
  
  It still does not pass
&lt;/h3&gt;

&lt;p&gt;If you have connected a custom domain to Lovable, DNS TXT becomes available. The record name is &lt;code&gt;_ismyappok-vuln.&amp;lt;your domain&amp;gt;&lt;/code&gt; and the value is the line shown on screen. It is not a shared subdomain, so this route is open to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  The token is not a secret
&lt;/h2&gt;

&lt;p&gt;The verification token is safe to publish. It is a string that shows you control the domain, and it does not protect anything by itself.&lt;/p&gt;

&lt;p&gt;In fact, being readable from the outside is the whole point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;To use vuln on a Lovable app, put one line in &lt;code&gt;public/.well-known/ismyappok-vuln.txt&lt;/code&gt;. That is enough, and you never touch DNS.&lt;/p&gt;

&lt;p&gt;Once it is in place, paste the URL and run the scan. You can check the rest of your setup with &lt;a href="https://ismyappok.com/en/audit?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=lovable-vuln-token" rel="noopener noreferrer"&gt;audit (no login)&lt;/a&gt; as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ismyappok.com/en/vuln?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=lovable-vuln-token" rel="noopener noreferrer"&gt;Check your public configuration (no login)&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
