svg-content-validation
v2.3.3
Published
A tool to validate SVG files by decoding Base64 content and ensuring security through structure checks and detection of dangerous tags.
Readme
svg-content-validation
svg-content-validation is a Node.js module designed to validate SVG files by decoding Base64 content, ensuring proper structure, and detecting potentially harmful tags or attributes.
Main Vision
This tool focuses on improving security when handling SVG files. It decodes Base64-encoded content within SVG files, validates the SVG structure, and flags any dangerous content such as <script>, <iframe>, onload, and more.
Features
- Base64 Decoding: Decodes any Base64-encoded content embedded inside SVG files.
- SVG Structure Validation: Verifies that the SVG file includes the proper XML namespace (
xmlns="http://www.w3.org/2000/svg"). - Recursive Directory Search: Scans all SVG files in a given directory, including subdirectories, for Base64 content and security risks.
Installation
To install svg-content-validation as an npm dependency, run:
npm install svg-content-validation