Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cure53/DOMPurify
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.4.5
Choose a base ref
...
head repository: cure53/DOMPurify
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.0.0
Choose a head ref

Commits on Jan 6, 2023

  1. Copy the full SHA
    7ab5ac5 View commit details
  2. chore: Removed MSIE-only features

    chore: Removed MSIE-only tests
    cure53 committed Jan 6, 2023
    Copy the full SHA
    a235578 View commit details
  3. Copy the full SHA
    5a28bcc View commit details
  4. test: Set Browserstack tests to run on Node 19

    test: Attempted to add Safari 15 to browser array
    cure53 committed Jan 6, 2023
    Copy the full SHA
    80380a9 View commit details
  5. Copy the full SHA
    3716d2a View commit details
  6. Merge pull request #752 from cure53/3.x

    Attempting a merge to check first 3.x version without MSIE cruft
    cure53 authored Jan 6, 2023
    Copy the full SHA
    33ad86f View commit details
  7. Copy the full SHA
    ff0f8f1 View commit details
  8. See #751

    test: Removed currently useless prototype pollution tests
    cure53 committed Jan 6, 2023
    Copy the full SHA
    42369a7 View commit details

Commits on Jan 7, 2023

  1. Copy the full SHA
    1e153bc View commit details
  2. test: Fixed a dumb typo

    cure53 committed Jan 7, 2023
    Copy the full SHA
    47d0842 View commit details
  3. Merge pull request #754 from cure53/main

    Getting 3.x branch to be in sync with main
    cure53 authored Jan 7, 2023
    Copy the full SHA
    8009566 View commit details

Commits on Jan 9, 2023

  1. Copy the full SHA
    592e840 View commit details
  2. Copy the full SHA
    33d6f4e View commit details
  3. Copy the full SHA
    a36917c View commit details
  4. Copy the full SHA
    f259f85 View commit details
  5. Merge pull request #756 from cure53/3.x

    Merged 3.x tests into main
    cure53 authored Jan 9, 2023
    Copy the full SHA
    1422f64 View commit details
  6. Copy the full SHA
    35fd270 View commit details
  7. Copy the full SHA
    a847101 View commit details
  8. Copy the full SHA
    fc33a24 View commit details
  9. Copy the full SHA
    b3cc1d0 View commit details

Commits on Jan 13, 2023

  1. Copy the full SHA
    1e9a595 View commit details
  2. Copy the full SHA
    a418ff5 View commit details
  3. Copy the full SHA
    da73a3e View commit details
  4. Copy the full SHA
    d074116 View commit details
  5. Copy the full SHA
    c906db3 View commit details
  6. Copy the full SHA
    09f5070 View commit details
  7. Copy the full SHA
    2c132e7 View commit details
  8. Merge pull request #757 from cure53/main

    Synching 3.x branch with main
    cure53 authored Jan 13, 2023
    Copy the full SHA
    4ca9005 View commit details
  9. Merge pull request #758 from cure53/3.x

    Merge pull request #757 from cure53/main
    cure53 authored Jan 13, 2023
    Copy the full SHA
    b0628d6 View commit details
  10. Merge pull request #759 from cure53/main

    Sync with main
    cure53 authored Jan 13, 2023
    Copy the full SHA
    0ace391 View commit details

Commits on Jan 26, 2023

  1. Copy the full SHA
    5945d66 View commit details
  2. Merge pull request #762 from cure53/3.x

    Merge changes from 3.x branch
    cure53 authored Jan 26, 2023
    Copy the full SHA
    5deaa35 View commit details
  3. test: Fixed a breaking comma

    cure53 committed Jan 26, 2023
    Copy the full SHA
    639c63a View commit details
  4. Copy the full SHA
    600fa00 View commit details
  5. Copy the full SHA
    ed9e938 View commit details
  6. Merge branch 'main' into 3.x

    cure53 authored Jan 26, 2023
    Copy the full SHA
    4394af9 View commit details

Commits on Feb 7, 2023

  1. Copy the full SHA
    8dd2763 View commit details

Commits on Feb 13, 2023

  1. see #767

    see #761
    
    feat: added better check for shadowrootmod
    feat: added ALLOW_SELF_CLOSE_IN_ATTR tag
    test: added test case
    cure53 committed Feb 13, 2023
    Copy the full SHA
    6e98d48 View commit details
  2. chore: preparing 3.0.0 release

    cure53 committed Feb 13, 2023
    Copy the full SHA
    5dcf2a0 View commit details
Showing with 560 additions and 749 deletions.
  1. +0 −1 .babelrc
  2. +3 −3 .github/workflows/build-and-test.yml
  3. +1 −1 LICENSE
  4. +6 −10 README.md
  5. +1 −1 bower.json
  6. +132 −63 dist/purify.cjs.js
  7. +1 −1 dist/purify.cjs.js.map
  8. +132 −63 dist/purify.es.js
  9. +1 −1 dist/purify.es.js.map
  10. +132 −63 dist/purify.js
  11. +1 −1 dist/purify.js.map
  12. +2 −2 dist/purify.min.js
  13. +1 −1 dist/purify.min.js.map
  14. +8 −5 package-lock.json
  15. +2 −2 package.json
  16. +13 −53 src/purify.js
  17. +6 −11 src/utils.js
  18. +83 −387 test/fixtures/expect.js
  19. +16 −23 test/karma.custom-launchers.config.js
  20. +17 −55 test/test-suite.js
  21. +2 −2 website/index.html
1 change: 0 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@
{
"targets": {
"chrome": 22,
"ie": 8,
"firefox": 15,
"opera": 31,
"safari": 8,
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ name: Build and Test
on:
push:
branches:
- main
- 3.x
pull_request:

jobs:
@@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 17.x, 18.x]
node-version: [16.x, 17.x, 18.x, 19.x]

steps:
- name: Checkout
@@ -37,7 +37,7 @@ jobs:
with:
run: npm run test:ci
env:
TEST_BROWSERSTACK: ${{ startsWith(matrix.node-version, '18') }}
TEST_BROWSERSTACK: ${{ startsWith(matrix.node-version, '19') }}
TEST_PROBE_ONLY: ${{ github.ref != 'refs/heads/main' }}
BS_USERNAME: ${{ secrets.BS_USERNAME }}
BS_ACCESSKEY: ${{ secrets.BS_ACCESSKEY }}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DOMPurify
Copyright 2015 Mario Heiderich
Copyright 2023 Dr.-Ing. Mario Heiderich, Cure53

DOMPurify is free software; you can redistribute it and/or modify it under the
terms of either:
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -6,13 +6,13 @@

DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG.

It's also very simple to use and get started with. DOMPurify was [started in February 2014](https://github.com/cure53/DOMPurify/commit/a630922616927373485e0e787ab19e73e3691b2b) and, meanwhile, has reached version 2.4.3.
It's also very simple to use and get started with. DOMPurify was [started in February 2014](https://github.com/cure53/DOMPurify/commit/a630922616927373485e0e787ab19e73e3691b2b) and, meanwhile, has reached version 3.0.0.

DOMPurify is written in JavaScript and works in all modern browsers (Safari (10+), Opera (15+), Internet Explorer (10+), Edge, Firefox and Chrome - as well as almost anything else using Blink or WebKit). It doesn't break on MSIE6 or other legacy browsers. It either uses [a fall-back](#what-about-older-browsers-like-msie8) or simply does nothing.
DOMPurify is written in JavaScript and works in all modern browsers (Safari (10+), Opera (15+), Edge, Firefox and Chrome - as well as almost anything else using Blink, Gecko or WebKit). It doesn't break on MSIE or other legacy browsers. It simply does nothing.

**Note that DOMPurify v2.4.3 is the final version supporting MSIE. For important security updates compatible with MSIE, please use the 2.x branch.**
**Note that [DOMPurify v2.4.4](https://github.com/cure53/DOMPurify/releases/tag/2.4.4) is the final version supporting MSIE. For important security updates compatible with MSIE, please use the [2.x branch](https://github.com/cure53/DOMPurify/tree/2.x).**

Our automated tests cover [19 different browsers](https://github.com/cure53/DOMPurify/blob/main/test/karma.custom-launchers.config.js#L5) right now, more to come. We also cover Node.js v14.x, v16.x, v17.x and v18.x, running DOMPurify on [jsdom](https://github.com/jsdom/jsdom). Older Node versions are known to work as well, but hey... no guarantees.
Our automated tests cover [19 different browsers](https://github.com/cure53/DOMPurify/blob/main/test/karma.custom-launchers.config.js#L5) right now, more to come. We also cover Node.js v16.x, v17.x, v18.x and v19.x, running DOMPurify on [jsdom](https://github.com/jsdom/jsdom). Older Node versions are known to work as well, but hey... no guarantees.

DOMPurify is written by security people who have vast background in web attacks and XSS. Fear not. For more details please also read about our [Security Goals & Threat Model](https://github.com/cure53/DOMPurify/wiki/Security-Goals-&-Threat-Model). Please, read it. Like, really.

@@ -145,13 +145,9 @@ DOMPurify.sanitize('<UL><li><A HREF=//google.com>click</UL>'); // becomes <ul><l

DOMPurify currently supports HTML5, SVG and MathML. DOMPurify per default allows CSS, HTML custom data attributes. DOMPurify also supports the Shadow DOM - and sanitizes DOM templates recursively. DOMPurify also allows you to sanitize HTML for being used with the jQuery `$()` and `elm.html()` API without any known problems.

## What about older browsers like MSIE8?
## What about legacy browsers like Internet Explorer?

DOMPurify offers a fall-back behavior for older MSIE browsers. It uses the MSIE-only `toStaticHTML` feature to sanitize. Note however that in this fall-back mode, pretty much none of the configuration flags shown below have any effect. You need to handle that yourself.

If not even `toStaticHTML` is supported, DOMPurify does nothing at all. It simply returns exactly the string that you fed it.

DOMPurify also exposes a property called `isSupported`, which tells you whether DOMPurify will be able to do its job.
DOMPurify does nothing at all. It simply returns exactly the string that you fed it. DOMPurify exposes a property called `isSupported`, which tells you whether it will be able to do its job, so you can come up with your own backup plan.

## What about DOMPurify and Trusted Types?

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DOMPurify",
"version": "2.4.3",
"version": "3.0.0",
"homepage": "https://github.com/cure53/DOMPurify",
"author": "Cure53 <info@cure53.de>",
"description": "A DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG",
Loading