all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 9a74b7b97166029b93982a08a2fd63c3216e4e87 1565 bytes (raw)
name: gnu/packages/patches/rust-comrak-0.7-rustsec-2021-0026.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
From 285e9647c6d2f90d8cb7af543b14c986a8efa631 Mon Sep 17 00:00:00 2001
From: Asherah Connor <ashe@kivikakk.ee>
Date: Fri, 12 Feb 2021 21:15:29 +1100
Subject: [PATCH] SECURITY: match unsafe prefixes case-insensitively

Many thanks to Kouhei Morita for reporting this.

Co-authored-by: Kouhei Morita <mrtc0@ssrf.in>
---
 src/lexer.pest |   2 +-
 src/tests.rs   | 146 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 147 insertions(+), 1 deletion(-)

diff --git a/src/lexer.pest b/src/lexer.pest
index e97647c..7f6cd3f 100644
--- a/src/lexer.pest
+++ b/src/lexer.pest
@@ -55,4 +55,4 @@ table_start = { "|"? ~ table_marker ~ ("|" ~ table_marker)* ~ "|"? ~ table_space
 table_cell_end = { "|" ~ table_spacechar* ~ table_newline? }
 table_row_end = { table_spacechar* ~ table_newline }

-dangerous_url = { "data:" ~ !("png" | "gif" | "jpeg" | "webp") | "javascript:" | "vbscript:" | "file:" }
+dangerous_url = { ^"data:" ~ !(^"image/" ~ (^"png" | ^"gif" | ^"jpeg" | ^"webp")) | ^"javascript:" | ^"vbscript:" | ^"file:" }
diff --git a/src/tests.rs b/src/tests.rs
index c61a493..5f3e0cc 100644
--- a/src/tests.rs
+++ b/src/tests.rs
@@ -998,3 +998,11 @@ fn description_lists() {
         ),
     );
 }
+
+#[test]
+fn case_insensitive_safety() {
+    html(
+        "[a](javascript:a) [b](Javascript:b) [c](jaVascript:c) [d](data:xyz) [e](Data:xyz) [f](vbscripT:f) [g](FILE:g)\n",
+        "<p><a href=\"\">a</a> <a href=\"\">b</a> <a href=\"\">c</a> <a href=\"\">d</a> <a href=\"\">e</a> <a href=\"\">f</a> <a href=\"\">g</a></p>\n",
+    );
+}
--
2.30.1

debug log:

solving 9a74b7b971 ...
found 9a74b7b971 in https://yhetil.org/guix/20210317202735.14024-6-leo.prikler@student.tugraz.at/ ||
	https://yhetil.org/guix/20210315175838.1931-6-leo.prikler@student.tugraz.at/ ||
	https://yhetil.org/guix/20210315171416.14446-6-leo.prikler@student.tugraz.at/ ||
	https://yhetil.org/guix/20210315154342.9437-6-leo.prikler@student.tugraz.at/ ||
	https://yhetil.org/guix/20210311220756.23132-6-leo.prikler@student.tugraz.at/ ||
	https://yhetil.org/guix/20210307173459.3048-6-leo.prikler@student.tugraz.at/ ||
	https://yhetil.org/guix/20210228184655.5159-8-leo.prikler@student.tugraz.at/

applying [1/1] https://yhetil.org/guix/20210317202735.14024-6-leo.prikler@student.tugraz.at/
diff --git a/gnu/packages/patches/rust-comrak-0.7-rustsec-2021-0026.patch b/gnu/packages/patches/rust-comrak-0.7-rustsec-2021-0026.patch
new file mode 100644
index 0000000000..9a74b7b971

Checking patch gnu/packages/patches/rust-comrak-0.7-rustsec-2021-0026.patch...
Applied patch gnu/packages/patches/rust-comrak-0.7-rustsec-2021-0026.patch cleanly.

skipping https://yhetil.org/guix/20210315175838.1931-6-leo.prikler@student.tugraz.at/ for 9a74b7b971
skipping https://yhetil.org/guix/20210315171416.14446-6-leo.prikler@student.tugraz.at/ for 9a74b7b971
skipping https://yhetil.org/guix/20210315154342.9437-6-leo.prikler@student.tugraz.at/ for 9a74b7b971
skipping https://yhetil.org/guix/20210311220756.23132-6-leo.prikler@student.tugraz.at/ for 9a74b7b971
skipping https://yhetil.org/guix/20210307173459.3048-6-leo.prikler@student.tugraz.at/ for 9a74b7b971
skipping https://yhetil.org/guix/20210228184655.5159-8-leo.prikler@student.tugraz.at/ for 9a74b7b971
index at:
100644 9a74b7b97166029b93982a08a2fd63c3216e4e87	gnu/packages/patches/rust-comrak-0.7-rustsec-2021-0026.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.