Skip to content

Commit

Permalink
Configure size limits for XML
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Sep 5, 2023
1 parent 8d48b60 commit 4d41498
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[package]
name = "svg-hush"
authors = ["Cloudflare <https://cloudflare.com>"]
version = "0.9.4"
version = "0.9.5"
edition = "2021"
description = "Strip scripting and other abusable features from SVG files"
categories = ["multimedia::images"]
keywords = ["xss", "sanitizer", "purify", "filter", "security"]
license = "Apache-2.0 OR MIT"
exclude = ["tests/"]
repository = "https://github.com/cloudflare/svg-hush"
rust-version = "1.57"
rust-version = "1.58"

[dependencies]
once_cell = "1.15.0"
data-url = "0.3.0"
base64 = "0.13.0"
quick-error = "2.0.1"
url = "2.3.1"
xml-rs = "0.8.16"
xml-rs = "0.8.17"

[package.metadata.release]
tag-name = "{{version}}"
Expand Down
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ impl Filter {
.cdata_to_characters(true)
.ignore_comments(true)
.coalesce_characters(false)
.allow_multiple_root_elements(false);
.allow_multiple_root_elements(false)
.max_attributes(200)
.max_entity_expansion_depth(3)
.max_data_length(1<<28)
.max_name_length(1000);
if let Some(ct) = &self.content_type {
config = config.content_type(&ct);
}
Expand Down

0 comments on commit 4d41498

Please sign in to comment.