Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
xml-sanitize-string
Advanced tools
This module replaces characters that are not valid in XML in a string with XML/HTML character entities (and vice versa).
This module replaces characters that are not valid in XML in a string with XML/HTML character entities (and vice versa).
Emoji, and many other characters are not valid in XML, and may cause problems if they sneak into your XML. This small module has two methods to sanitize (escape invalid characters) a string, and to unescape a string.
Install xml-sanitize-string
via NPM:
npm install xml-sanitize-string
In Node:
var xmlSanitizeString = require('xml-sanitize-string');
// Sanatize a string for use in XML by escaping invalid characters to XML character entities.
xmlSanitizeString.escape('Some 👉 invalid 💻 characters 🎒')
// Some f449; invalid f4bb; characters f392;
// Unescape a string containing XML character entities to unicode characters
xmlSanitizeString.unescape('Some f449; invalid f4bb; characters f392;')
// Some 👉 invalid 💻 characters 🎒
xml-sanitize-string was built by Nick Drewe to deal with user searches on searchmy.bio that may contain emoji, or other characters that are invalid in XML.
FAQs
This module replaces characters that are not valid in XML in a string with XML/HTML character entities (and vice versa).
We found that xml-sanitize-string demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.