Socket
Socket
Sign inDemoInstall

@braintree/sanitize-url

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@braintree/sanitize-url - npm Package Versions

13

6.0.0

Diff

Changelog

Source

6.0.0

Breaking Changes

  • Decode HTML characters automatically that would result in an XSS vulnerability when rendering links via a server rendered HTML file
// decodes to javacript:alert('XSS')
const vulnerableUrl =
  "&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041";

sanitizeUrl(vulnerableUrl); // 'about:blank'

const okUrl = "https://example.com/" + vulnerableUrl;

// since the javascript bit is in the path instead of the protocol
// this is successfully sanitized
sanitizeUrl(okUrl); // 'https://example.com/javascript:alert('XSS');
braintree
published 5.0.2 •

Changelog

Source

5.0.2

  • Fix issue where certain invisible white space characters were not being sanitized (#35)
braintree
published 5.0.1 •

Changelog

Source

5.0.1

  • Fix issue where certain safe characters were being filtered out (#31 thanks @akirchmyer)
braintree
published 5.0.0 •

Changelog

Source

5.0.0

Breaking Changes

  • Sanitize vbscript urls (thanks @vicnicius)
braintree
published 4.1.1 •

Changelog

Source

4.1.1

  • Fixup path to type declaration (closes #25)
braintree
published 4.1.0 •

Changelog

Source

4.1.0

  • Add typescript types
braintree
published 4.0.1 •

Changelog

Source

4.0.1

  • Fix issue where urls with accented characters were incorrectly sanitized
braintree
published 4.0.0 •

Changelog

Source

4.0.0

Breaking Changes

  • Protocol-less urls (ie: www.example.com) will be sanitised and passed on instead of sending out about:blank (Thanks @chawes13 #18)
braintree
published 3.1.0 •

Changelog

Source

3.1.0

  • Trim whitespace from urls
braintree
published 3.0.0 •

Changelog

Source

3.0.0

breaking changes

  • Replace blank strings with about:blank
  • Replace null values with about:blank
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc