[{"data":1,"prerenderedAt":488},["ShallowReactive",2],{"rule-obfuscated-vendor-code":3},{"id":4,"title":5,"body":6,"breadcrumb":451,"coderail":458,"dateModified":477,"datePublished":477,"description":478,"extension":479,"meta":480,"navigation":481,"next":477,"path":482,"prev":477,"schemaType":483,"seo":484,"stem":485,"wide":486,"__hash__":487},"docs\u002Frules\u002Fobfuscated-vendor-code.md","Obfuscated vendor code detected",{"type":7,"value":8,"toc":443},"minimark",[9,16,54,59,80,84,94,98,324,328,349,353,411,415,439],[10,11,12],"p",{},[13,14,15],"strong",{},"Summary",[17,18,19,30,36,42,48],"ul",{},[20,21,22,25,26],"li",{},[13,23,24],{},"rule_id"," — ",[27,28,29],"code",{},"obfuscated-vendor-code",[20,31,32,35],{},[13,33,34],{},"purpose"," — Detect Custom HTML tags that use runtime obfuscation to construct URLs or code",[20,37,38,41],{},[13,39,40],{},"effect"," — Tag behavior cannot be verified through static analysis; actual data destinations are hidden",[20,43,44,47],{},[13,45,46],{},"layer"," — container",[20,49,50,53],{},[13,51,52],{},"reversibility"," — non-destructive",[55,56,58],"h2",{"id":57},"what-fires-this","What fires this",[10,60,61,62,64,65,68,69,72,73,68,76,79],{},"The rule iterates over active Custom HTML tags and checks each tag's ",[27,63,27],{}," property for two obfuscation patterns. The first pattern matches ",[27,66,67],{},"atob("," combined with ",[27,70,71],{},"String.fromCharCode"," — a technique that decodes base64 strings into character sequences at runtime. The second pattern matches ",[27,74,75],{},"charCodeAt(",[27,77,78],{},"fromCharCode"," — a character-level encoding loop. A tag triggers the rule if either pattern is present. Paused tags are excluded from evaluation.",[55,81,83],{"id":82},"why-it-matters","Why it matters",[10,85,86,87,90,91,93],{},"Obfuscated code hides its behavior from any tool that reads the container statically. The actual destination URLs, data payloads, and collection practices are only visible at runtime — and only to whoever controls the tag. A vendor can update what the obfuscated code decodes to without any change appearing in the container diff. This prevents meaningful auditing for PII handling, data sharing agreements, or consent scope. The ",[27,88,89],{},"atob"," + ",[27,92,71],{}," combination is a known technique for embedding unpublished endpoints in GTM (Google Tag Manager) tags.",[55,95,97],{"id":96},"example","Before \u002F after",[99,100,101,270],"compare",{},[102,103,105],"compare-col",{"label":104},"Before — flagged",[106,107,112],"pre",{"className":108,"code":109,"language":110,"meta":111,"style":111},"language-js shiki shiki-themes github-light github-dark","\u002F\u002F Vendor-supplied Custom HTML tag\nvar _d = atob('aHR0cHM6Ly90cmFjay52ZW5kb3IuY29tL2NvbGxlY3Q=');\nvar _u = '';\nfor (var i = 0; i \u003C _d.length; i++) {\n  _u += String.fromCharCode(_d.charCodeAt(i));\n}\n\u002F\u002F _u is now the destination URL — not visible in static analysis\nfetch(_u, { method: 'POST', body: JSON.stringify(payload) });\n","js","",[27,113,114,123,151,167,208,231,237,243],{"__ignoreMap":111},[115,116,119],"span",{"class":117,"line":118},"line",1,[115,120,122],{"class":121},"sJ8bj","\u002F\u002F Vendor-supplied Custom HTML tag\n",[115,124,126,130,134,137,141,144,148],{"class":117,"line":125},2,[115,127,129],{"class":128},"szBVR","var",[115,131,133],{"class":132},"sVt8B"," _d ",[115,135,136],{"class":128},"=",[115,138,140],{"class":139},"sScJk"," atob",[115,142,143],{"class":132},"(",[115,145,147],{"class":146},"sZZnC","'aHR0cHM6Ly90cmFjay52ZW5kb3IuY29tL2NvbGxlY3Q='",[115,149,150],{"class":132},");\n",[115,152,154,156,159,161,164],{"class":117,"line":153},3,[115,155,129],{"class":128},[115,157,158],{"class":132}," _u ",[115,160,136],{"class":128},[115,162,163],{"class":146}," ''",[115,165,166],{"class":132},";\n",[115,168,170,173,176,178,181,183,187,190,193,196,199,202,205],{"class":117,"line":169},4,[115,171,172],{"class":128},"for",[115,174,175],{"class":132}," (",[115,177,129],{"class":128},[115,179,180],{"class":132}," i ",[115,182,136],{"class":128},[115,184,186],{"class":185},"sj4cs"," 0",[115,188,189],{"class":132},"; i ",[115,191,192],{"class":128},"\u003C",[115,194,195],{"class":132}," _d.",[115,197,198],{"class":185},"length",[115,200,201],{"class":132},"; i",[115,203,204],{"class":128},"++",[115,206,207],{"class":132},") {\n",[115,209,211,214,217,220,222,225,228],{"class":117,"line":210},5,[115,212,213],{"class":132},"  _u ",[115,215,216],{"class":128},"+=",[115,218,219],{"class":132}," String.",[115,221,78],{"class":139},[115,223,224],{"class":132},"(_d.",[115,226,227],{"class":139},"charCodeAt",[115,229,230],{"class":132},"(i));\n",[115,232,234],{"class":117,"line":233},6,[115,235,236],{"class":132},"}\n",[115,238,240],{"class":117,"line":239},7,[115,241,242],{"class":121},"\u002F\u002F _u is now the destination URL — not visible in static analysis\n",[115,244,246,249,252,255,258,261,264,267],{"class":117,"line":245},8,[115,247,248],{"class":139},"fetch",[115,250,251],{"class":132},"(_u, { method: ",[115,253,254],{"class":146},"'POST'",[115,256,257],{"class":132},", body: ",[115,259,260],{"class":185},"JSON",[115,262,263],{"class":132},".",[115,265,266],{"class":139},"stringify",[115,268,269],{"class":132},"(payload) });\n",[102,271,273],{"label":272},"After — fixed",[106,274,276],{"className":108,"code":275,"language":110,"meta":111,"style":111},"\u002F\u002F Vendor provides the endpoint directly — auditable\nfetch('https:\u002F\u002Ftrack.vendor.com\u002Fcollect', {\n  method: 'POST',\n  body: JSON.stringify(payload)\n});\n",[27,277,278,283,295,305,319],{"__ignoreMap":111},[115,279,280],{"class":117,"line":118},[115,281,282],{"class":121},"\u002F\u002F Vendor provides the endpoint directly — auditable\n",[115,284,285,287,289,292],{"class":117,"line":125},[115,286,248],{"class":139},[115,288,143],{"class":132},[115,290,291],{"class":146},"'https:\u002F\u002Ftrack.vendor.com\u002Fcollect'",[115,293,294],{"class":132},", {\n",[115,296,297,300,302],{"class":117,"line":153},[115,298,299],{"class":132},"  method: ",[115,301,254],{"class":146},[115,303,304],{"class":132},",\n",[115,306,307,310,312,314,316],{"class":117,"line":169},[115,308,309],{"class":132},"  body: ",[115,311,260],{"class":185},[115,313,263],{"class":132},[115,315,266],{"class":139},[115,317,318],{"class":132},"(payload)\n",[115,320,321],{"class":117,"line":210},[115,322,323],{"class":132},"});\n",[55,325,327],{"id":326},"remediation","Remediation",[329,330,331,334,337,340,343,346],"ol",{},[20,332,333],{},"Identify every flagged tag in the audit results and note the vendor name for each.",[20,335,336],{},"Contact the vendor and request an unobfuscated version of the tag.",[20,338,339],{},"Check whether the vendor publishes an official GTM Community Template — prefer that over a Custom HTML tag.",[20,341,342],{},"If the vendor cannot or will not provide readable code, evaluate whether the tag is necessary and remove it if not.",[20,344,345],{},"Replace accepted tags with the unobfuscated version and verify the destination domains match what the vendor documented.",[20,347,348],{},"Add the destination domain to your approved-vendor list and re-run the audit to confirm the flag clears.",[55,350,352],{"id":351},"metadata","Metadata",[354,355,358,359,364,358,368,372,358,375,379,358,382,385,358,388,392,358,395,399,358,405,408],"dl",{"className":356},[357],"spec-list","\n  ",[360,361,363],"dt",{"id":362},"severity","Severity",[365,366,367],"dd",{},"low",[360,369,371],{"id":370},"tier","Tier",[365,373,374],{},"info",[360,376,378],{"id":377},"category","Category",[365,380,381],{},"security",[360,383,384],{"id":46},"Layer",[365,386,387],{},"container",[360,389,391],{"id":390},"version","Version",[365,393,394],{},"1",[360,396,398],{"id":397},"effort","Effort",[365,400,401,404],{},[27,402,403],{},"strategic"," (no fixed time; needs a plan)",[360,406,407],{"id":52},"Reversibility",[365,409,410],{},"non-destructive",[55,412,414],{"id":413},"see-also","See also",[17,416,417,425,432],{},[20,418,419,424],{},[420,421,423],"a",{"href":422},"\u002Fcategories\u002Fsecurity\u002F","Security rules"," — other rules in this category",[20,426,427,431],{},[420,428,430],{"href":429},"\u002Fhealth-score\u002F","Health score"," — how this rule contributes to the score",[20,433,434,438],{},[420,435,437],{"href":436},"\u002Frules\u002F","Rules catalog"," — browse all rules",[440,441,442],"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 pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}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":111,"searchDepth":125,"depth":125,"links":444},[445,446,447,448,449,450],{"id":57,"depth":125,"text":58},{"id":82,"depth":125,"text":83},{"id":96,"depth":125,"text":97},{"id":326,"depth":125,"text":327},{"id":351,"depth":125,"text":352},{"id":413,"depth":125,"text":414},[452,455,457],{"label":453,"href":454},"API Reference","\u002F",{"label":456,"href":436},"Rules",{"label":29},{"cards":459,"onpage":471},[460],{"title":461,"tabs":462},"Evaluate",[463,467],{"label":464,"language":465,"code":466},"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\":\"obfuscated-vendor-code\",\"url\":\"https:\u002F\u002Fexample.com\"}'\n",{"label":468,"language":469,"code":470},"MCP","text","User: Run obfuscated-vendor-code on https:\u002F\u002Fexample.com\n\n# Tool call\n{\n  \"tool\": \"evaluate_rule\",\n  \"arguments\": {\n    \"rule_id\": \"obfuscated-vendor-code\",\n    \"url\": \"https:\u002F\u002Fexample.com\"\n  }\n}\n",[472,473,474,475,476],{"id":57,"label":58},{"id":82,"label":83},{"id":96,"label":97},{"id":326,"label":327},{"id":351,"label":352},null,"Custom HTML tags use obfuscation techniques (atob + String.fromCharCode, charCodeAt + fromCharCode) to construct URLs or code at runtime. This makes the tag's behavior impossible to verify through static analysis.","md",{},true,"\u002Frules\u002Fobfuscated-vendor-code","TechArticle",{"title":5,"description":478},"rules\u002Fobfuscated-vendor-code",false,"tp0vYn1vDBeBFtt01nGG5VBmxAkhh40H77TyXQtqfdE",1796069484479]