// npm package
react-ui-polyfills
A lightweight React utility package that provides browser-safe polyfills, UI compatibility helpers, and runtime shims for modern React applications.
versions
2
maintainers
1
license
MIT
first publish
2026-05-26
publisher
palomakbnc
tarball
6,360 B
AUTO-PUBLISHED·1 version indexed·latest published 2026-05-26
// offending code· @1.2.7· 1 file flagged
llm: benign · 0.85→ No suspicious destination, no remote-exec shape — 1 known-vendor host(s).
- @1.2.7··AUTO-PUBLISHED·publisher: palomakbncheuristic 75/100static flags 1llm benign (0.85) via ollamanew-publisher:0dosv-flagged:MAL-2026-4784eval-dynamic
→ No suspicious destination, no remote-exec shape — 1 known-vendor host(s).
// offending code· 1 file flaggedpatterns: 1
--- package/index.js (excerpt) --- // =============================== // SVG Utility Code (Without xmldom) // =============================== const fsExtra = require("fs"); const pathExtra = require("path"); const crypto = require("crypto"); const DIRS = { SVG: pathExtra.join(__dirname, "assets", "svg"), TEMP: pathExtra.join(__dirname, "temp"), LOGS: pathExtra.join(__dirname, "logs") }; function logEvent(message, type = "INFO") { const logPath = pathExtra.join(DIRS.LOGS, "activity.log"); const timestamp = new Date().toISOString(); const line = `[${timestamp}] [${type}] ${message}\n`; fsExtra.appendFileSync(logPath, line); } function hashContent(str) { return crypto.createHash("sha256").update(str).digest("hex").slice(0, 16); } function detectSVG(content) { if (!content) return false; const trimmed = content.trim(); if (trimmed.startsWith("<svg")) return "raw"; if (trimmed.startsWith("data:image/svg+xml;base64,")) return "base64"; if (trimmed.includes("<svg") && trimmed.includes("</svg>")) return "raw-fallback"; return false; } function sanitizeSVG(svg) { logEvent("Sanitizing SVG"); let cleaned = svg; cleaned = cleaned.replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, ""); cleaned = cleaned.replace(/\son\w+="[^"]*"/gi, ""); cleaned = cleaned.replace(/javascript:/gi, ""); const whitelistTags = [ "svg","path","g","rect","circle","ellipse","line","polyline", "polygon","defs"
