Skip to content

Commit 1832a15

Browse files
committed
Fix local file read vulnerability in WeasyPrint
1 parent 9d4b535 commit 1832a15

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pod/fetcher.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ def open_data_url(url):
221221

222222

223223
def fetcher(url):
224+
if url.lower().startswith('file:'):
225+
raise ValueError('No local files allowed')
226+
224227
if url.lower().startswith('data:'):
225228
return open_data_url(url)
226229
elif UNICODE_SCHEME_RE.match(url):

0 commit comments

Comments
 (0)