Browse Source

document pattern denial of service

(cherry picked from commit 1f5ddb6572a68d85cae730ff0c04fae85f7e7d0d)
Marian Beermann 8 năm trước cách đây
mục cha
commit
10b196d532
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      borg/archiver.py

+ 9 - 0
borg/archiver.py

@@ -989,6 +989,15 @@ class Archiver:
             This pattern style is useful to match whole sub-directories. The pattern
             This pattern style is useful to match whole sub-directories. The pattern
             `pp:/data/bar` matches `/data/bar` and everything therein.
             `pp:/data/bar` matches `/data/bar` and everything therein.
 
 
+        .. note::
+
+            `re:`, `sh:` and `fm:` patterns are all implemented on top of the Python SRE
+            engine. It is very easy to formulate patterns for each of these types which
+            requires an inordinate amount of time to match paths. If untrusted users
+            are able to supply patterns, ensure they cannot supply `re:` patterns.
+            Further, ensure that `sh:` and `fm:` patterns only contain a handful of
+            wildcards at most.
+
         Exclusions can be passed via the command line option `--exclude`. When used
         Exclusions can be passed via the command line option `--exclude`. When used
         from within a shell the patterns should be quoted to protect them from
         from within a shell the patterns should be quoted to protect them from
         expansion.
         expansion.