[{"data":1,"prerenderedAt":398},["ShallowReactive",2],{"rule-http-script-loading":3},{"id":4,"title":5,"body":6,"breadcrumb":361,"coderail":368,"dateModified":387,"datePublished":387,"description":388,"extension":389,"meta":390,"navigation":391,"next":387,"path":392,"prev":387,"schemaType":393,"seo":394,"stem":395,"wide":396,"__hash__":397},"docs\u002Frules\u002Fhttp-script-loading.md","HTTP (non-secure) resource loading",{"type":7,"value":8,"toc":353},"minimark",[9,16,58,63,85,89,92,96,223,227,259,263,321,325,349],[10,11,12],"p",{},[13,14,15],"strong",{},"Summary",[17,18,19,30,40,46,52],"ul",{},[20,21,22,25,26],"li",{},[13,23,24],{},"rule_id"," — ",[27,28,29],"code",{},"http-script-loading",[20,31,32,35,36,39],{},[13,33,34],{},"purpose"," — Detect tags that load external scripts or assign ",[27,37,38],{},"src"," values over HTTP instead of HTTPS",[20,41,42,45],{},[13,43,44],{},"effect"," — HTTP resources can be intercepted and modified in transit; modern browsers block mixed content by default",[20,47,48,51],{},[13,49,50],{},"layer"," — container",[20,53,54,57],{},[13,55,56],{},"reversibility"," — non-destructive",[59,60,62],"h2",{"id":61},"what-fires-this","What fires this",[10,64,65,66,69,70,73,74,76,77,80,81,84],{},"The rule runs two detection modes against active Custom HTML tags. Mode 1 reads ",[27,67,68],{},"codeAnalysis.externalScriptUrls"," and flags any URL beginning with ",[27,71,72],{},"http:\u002F\u002F",". Mode 2 scans tag code for ",[27,75,38],{}," assignment patterns matching ",[27,78,79],{},"\u002F.src\\s*=\\s*['\"]http:\\\u002F\\\u002Fi"," or ",[27,82,83],{},"src\\s*=\\s*['\"]http:\\\u002F\\\u002Fi",", catching cases the parser does not extract as discrete URLs. A tag triggers only once — if Mode 1 already caught it, Mode 2 skips it. Paused tags are excluded from both modes.",[59,86,88],{"id":87},"why-it-matters","Why it matters",[10,90,91],{},"HTTP connections are plaintext. A network-level attacker — on shared Wi-Fi, a compromised CDN node, or a BGP route leak — can modify the script payload before it reaches the browser. The injected code executes with full access to the page. Modern browsers block mixed-content active resources by default, so the tag silently fails to load. Switching to HTTPS removes the interception surface and eliminates browser blocking with no observable change to tag behavior.",[59,93,95],{"id":94},"example","Before \u002F after",[97,98,99,175],"compare",{},[100,101,103],"compare-col",{"label":102},"Before — flagged",[104,105,110],"pre",{"className":106,"code":107,"language":108,"meta":109,"style":109},"language-js shiki shiki-themes github-light github-dark","\u002F\u002F External SDK loaded over HTTP\nvar script = document.createElement('script')\nscript.src = 'http:\u002F\u002Fcdn.example-vendor.com\u002Fsdk.js'\ndocument.head.appendChild(script)\n","js","",[27,111,112,121,152,163],{"__ignoreMap":109},[113,114,117],"span",{"class":115,"line":116},"line",1,[113,118,120],{"class":119},"sJ8bj","\u002F\u002F External SDK loaded over HTTP\n",[113,122,124,128,132,135,138,142,145,149],{"class":115,"line":123},2,[113,125,127],{"class":126},"szBVR","var",[113,129,131],{"class":130},"sVt8B"," script ",[113,133,134],{"class":126},"=",[113,136,137],{"class":130}," document.",[113,139,141],{"class":140},"sScJk","createElement",[113,143,144],{"class":130},"(",[113,146,148],{"class":147},"sZZnC","'script'",[113,150,151],{"class":130},")\n",[113,153,155,158,160],{"class":115,"line":154},3,[113,156,157],{"class":130},"script.src ",[113,159,134],{"class":126},[113,161,162],{"class":147}," 'http:\u002F\u002Fcdn.example-vendor.com\u002Fsdk.js'\n",[113,164,166,169,172],{"class":115,"line":165},4,[113,167,168],{"class":130},"document.head.",[113,170,171],{"class":140},"appendChild",[113,173,174],{"class":130},"(script)\n",[100,176,178],{"label":177},"After — fixed",[104,179,181],{"className":106,"code":180,"language":108,"meta":109,"style":109},"\u002F\u002F Upgraded to HTTPS\nvar script = document.createElement('script')\nscript.src = 'https:\u002F\u002Fcdn.example-vendor.com\u002Fsdk.js'\ndocument.head.appendChild(script)\n",[27,182,183,188,206,215],{"__ignoreMap":109},[113,184,185],{"class":115,"line":116},[113,186,187],{"class":119},"\u002F\u002F Upgraded to HTTPS\n",[113,189,190,192,194,196,198,200,202,204],{"class":115,"line":123},[113,191,127],{"class":126},[113,193,131],{"class":130},[113,195,134],{"class":126},[113,197,137],{"class":130},[113,199,141],{"class":140},[113,201,144],{"class":130},[113,203,148],{"class":147},[113,205,151],{"class":130},[113,207,208,210,212],{"class":115,"line":154},[113,209,157],{"class":130},[113,211,134],{"class":126},[113,213,214],{"class":147}," 'https:\u002F\u002Fcdn.example-vendor.com\u002Fsdk.js'\n",[113,216,217,219,221],{"class":115,"line":165},[113,218,168],{"class":130},[113,220,171],{"class":140},[113,222,174],{"class":130},[59,224,226],{"id":225},"remediation","Remediation",[228,229,230,236,246,253,256],"ol",{},[20,231,232,233,235],{},"Open each flagged tag and locate every ",[27,234,72],{}," URL in the code.",[20,237,238,239,241,242,245],{},"Replace ",[27,240,72],{}," with ",[27,243,244],{},"https:\u002F\u002F"," on each URL.",[20,247,248,249,252],{},"If the vendor endpoint does not respond over HTTPS, use a protocol-relative URL (",[27,250,251],{},"\u002Fcdn.example-vendor.com\u002Fsdk.js",") so the browser inherits the page protocol.",[20,254,255],{},"Confirm the vendor CDN responds correctly over HTTPS before saving.",[20,257,258],{},"Publish the updated tag and verify no mixed-content warnings appear in browser DevTools.",[59,260,262],{"id":261},"metadata","Metadata",[264,265,268,269,274,268,278,282,268,285,289,268,292,295,268,298,302,268,305,309,268,315,318],"dl",{"className":266},[267],"spec-list","\n  ",[270,271,273],"dt",{"id":272},"severity","Severity",[275,276,277],"dd",{},"high",[270,279,281],{"id":280},"tier","Tier",[275,283,284],{},"error",[270,286,288],{"id":287},"category","Category",[275,290,291],{},"security",[270,293,294],{"id":50},"Layer",[275,296,297],{},"container",[270,299,301],{"id":300},"version","Version",[275,303,304],{},"1",[270,306,308],{"id":307},"effort","Effort",[275,310,311,314],{},[27,312,313],{},"15min"," (about 15 minutes)",[270,316,317],{"id":56},"Reversibility",[275,319,320],{},"non-destructive",[59,322,324],{"id":323},"see-also","See also",[17,326,327,335,342],{},[20,328,329,334],{},[330,331,333],"a",{"href":332},"\u002Fcategories\u002Fsecurity\u002F","Security rules"," — other rules in this category",[20,336,337,341],{},[330,338,340],{"href":339},"\u002Fhealth-score\u002F","Health score"," — how this rule contributes to the score",[20,343,344,348],{},[330,345,347],{"href":346},"\u002Frules\u002F","Rules catalog"," — browse all rules",[350,351,352],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":109,"searchDepth":123,"depth":123,"links":354},[355,356,357,358,359,360],{"id":61,"depth":123,"text":62},{"id":87,"depth":123,"text":88},{"id":94,"depth":123,"text":95},{"id":225,"depth":123,"text":226},{"id":261,"depth":123,"text":262},{"id":323,"depth":123,"text":324},[362,365,367],{"label":363,"href":364},"API Reference","\u002F",{"label":366,"href":346},"Rules",{"label":29},{"cards":369,"onpage":381},[370],{"title":371,"tabs":372},"Evaluate",[373,377],{"label":374,"language":375,"code":376},"cURL","bash","curl https:\u002F\u002Fdeveloper.tagmanifest.com\u002Fv1\u002Fevaluate-rule \\\n  -H \"Authorization: Bearer $TM_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"rule_id\":\"http-script-loading\",\"url\":\"https:\u002F\u002Fexample.com\"}'\n",{"label":378,"language":379,"code":380},"MCP","text","User: Run http-script-loading on https:\u002F\u002Fexample.com\n\n# Tool call\n{\n  \"tool\": \"evaluate_rule\",\n  \"arguments\": {\n    \"rule_id\": \"http-script-loading\",\n    \"url\": \"https:\u002F\u002Fexample.com\"\n  }\n}\n",[382,383,384,385,386],{"id":61,"label":62},{"id":87,"label":88},{"id":94,"label":95},{"id":225,"label":226},{"id":261,"label":262},null,"Tags reference HTTP URLs instead of HTTPS. Creates mixed content warnings and is a security risk — HTTP resources can be intercepted and modified.","md",{},true,"\u002Frules\u002Fhttp-script-loading","TechArticle",{"title":5,"description":388},"rules\u002Fhttp-script-loading",false,"iGMjLWfxhaVJLtMaQGG05u-dGySunPy_BKJWevnyngo",1796069484434]