HTTP (non-secure) resource loading
Tags reference HTTP URLs instead of HTTPS. Creates mixed content warnings and is a security risk — HTTP resources can be intercepted and modified.
Summary
- rule_id —
http-script-loading - purpose — Detect tags that load external scripts or assign
srcvalues over HTTP instead of HTTPS - effect — HTTP resources can be intercepted and modified in transit; modern browsers block mixed content by default
- layer — container
- reversibility — non-destructive
What fires this
The rule runs two detection modes against active Custom HTML tags. Mode 1 reads codeAnalysis.externalScriptUrls and flags any URL beginning with http://. Mode 2 scans tag code for src assignment patterns matching /.src\s*=\s*['"]http:\/\/i or src\s*=\s*['"]http:\/\/i, 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.
Why it matters
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.
Before / after
// External SDK loaded over HTTP
var script = document.createElement('script')
script.src = 'http://cdn.example-vendor.com/sdk.js'
document.head.appendChild(script)
// Upgraded to HTTPS
var script = document.createElement('script')
script.src = 'https://cdn.example-vendor.com/sdk.js'
document.head.appendChild(script)
Remediation
- Open each flagged tag and locate every
http://URL in the code. - Replace
http://withhttps://on each URL. - If the vendor endpoint does not respond over HTTPS, use a protocol-relative URL (
/cdn.example-vendor.com/sdk.js) so the browser inherits the page protocol. - Confirm the vendor CDN responds correctly over HTTPS before saving.
- Publish the updated tag and verify no mixed-content warnings appear in browser DevTools.
Metadata
- Severity
- high
- Tier
- error
- Category
- security
- Layer
- container
- Version
- 1
- Effort
15min(about 15 minutes)- Reversibility
- non-destructive
See also
- Security rules — other rules in this category
- Health score — how this rule contributes to the score
- Rules catalog — browse all rules
Examples
curl https://developer.tagmanifest.com/v1/evaluate-rule \
-H "Authorization: Bearer $TM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"rule_id":"http-script-loading","url":"https://example.com"}'
User: Run http-script-loading on https://example.com
# Tool call
{
"tool": "evaluate_rule",
"arguments": {
"rule_id": "http-script-loading",
"url": "https://example.com"
}
}