url-sanitization

Validate and sanitize URLs from HTML against approved schemes.

836|66|Updated Feb 3, 2025
One-click install
npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill url-sanitization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: url-sanitization
Source: https://github.com/kreuzberg-dev/html-to-markdown/tree/main/.ai-rulez/domains/conversion-algorithms/skills/url-sanitization
Command: npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill url-sanitization

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents security vulnerabilities by validating and sanitizing URLs found in web content, ensuring only safe and expected protocols are used.

Core Features & Use Cases

  • Scheme Validation: Ensures URLs use approved protocols (http, https, mailto, ftp, etc.).
  • Dangerous Scheme Blocking: Actively blocks potentially harmful schemes like javascript: or data:.
  • Use Case: When converting HTML to Markdown, this skill ensures that any links or image sources do not contain malicious code or redirect users to unsafe locations.

Quick Start

Sanitize the URL 'javascript:alert("XSS")' to ensure it is safe for use.

Frequently Asked Questions about url-sanitization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sanitize URLs extracted from HTML content to prevent XSS attacks?

To sanitize URLs extracted from HTML content, you must validate them against a predefined list of safe schemes. This process actively blocks dangerous protocols like javascript: to prevent XSS attacks and ensure web scraping security.

What URL schemes are blocked during the HTML sanitization process?

During HTML sanitization, dangerous URL schemes like javascript: and data: are actively blocked. The process strictly enforces approved protocols such as http, https, mailto, and ftp to ensure only safe URL schemes are used.

Why do I need URL validation when converting HTML to Markdown?

You need URL validation when converting HTML to Markdown to ensure that extracted links and image sources do not contain malicious code. Sanitization prevents unsafe redirects and blocks potentially harmful schemes during content conversion.

Does URL sanitization support user-generated content moderation?

Yes, URL sanitization supports user-generated content moderation by validating and sanitizing URLs found in web content. It ensures only safe and expected protocols are used, mitigating security vulnerabilities in dynamic user submissions.

What is the best way to handle dangerous URL schemes in web scraping?

The best way to handle dangerous URL schemes in web scraping is to apply strict scheme validation. By adhering to a predefined list of safe protocols and rejecting dangerous ones, you prevent security risks from malicious URLs.