Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

markdown-sanitizers

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-sanitizers

This repository contains 2 related npm packages concerned with hardening markdown against [data exfiltration attacks through LLM prompt-injection](https://vercel.com/blog/building-secure-ai-agents#exfiltration-through-model-output).

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Markdown sanitizers

This repository contains 2 related npm packages concerned with hardening markdown against data exfiltration attacks through LLM prompt-injection.

The 2 projects which address 2 different use cases:

  • You render the markdown to HTML yourself
  • You're giving the markdown to a third-party such as GitHub or GitLab where you don't control the rendering

You render the markdown to HTML yourself

This is the more common use-case. It's also the variant that is easier to secure, because you have full control over the process. harden-react-markdown is a wrapper for the popular react-markdown package giving it more secure defaults, and giving you the ability to allow-list URL prefixes in images and links.

2. You're giving the markdown to a third-party such as GitHub or GitLab where you don't control the rendering

We created markdown-to-markdown-sanitizer for this use-case. Generally speaking, this is less secure than sanitizing the final rendered output such as the generated HTML. Hence, this package should only be used when the markdown is rendered by a third-party such as GitHub or GitLab.

Security properties

The packages in this repository have subtle security properties. Use at your own risk (see LICENSE) and perform your own security testing for specific application.

FAQs

Package last updated on 03 Sep 2025

Did you know?

Socket

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.

Install

Related posts