
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
form-text-sanitizer
Advanced tools
Sanitize strings — expecting text — from html, svg, erb, and mustache expressions.
form-text-sanitizer is a super-fast string sanitizer checking for HTML, SVG, ERB, and Mustache Expressions that may be contained inside input text. It is intended to prevent XSS Attacks.
Installation:
npm i form-text-sanitizer
Import the checkAndSanitizeString
function to your JavaScript file:
import checkAndSanitizeString from "form-text-sanitizer";
Input the string you wish to sanitize and (optionally) destructure the response:
const { originalString, suggestedString, matches } = checkAndSanitizeString("My message: <Script>alert('XSS')</SCRIPT>End message.");
In the above example the response will be:
{
originalString: "My message: <script>alert('XSS')</SCRIPT>End message.",
suggestedString: "My message: End message.",
matches: ["<script>alert('XSS')</SCRIPT>"]
}
originalString
- User input string
suggestedString
- Sanitized string
matches
- Array of string(s) that are potentially malicious.
This can be empty if no such strings are detected. In this case, suggestedString
and originalString
will be the same.
FAQs
Sanitize strings — expecting text — from html, svg, erb, and mustache expressions.
The npm package form-text-sanitizer receives a total of 0 weekly downloads. As such, form-text-sanitizer popularity was classified as not popular.
We found that form-text-sanitizer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.