mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2025-11-03 19:30:22 +00:00
Tighten unpaper-args validation to exclude . and ..
Just in case
This commit is contained in:
parent
bfe4a5b329
commit
28eec73eed
@ -107,7 +107,7 @@ def run(input_file, output_file, dpi, mode_args):
|
||||
|
||||
def validate_custom_args(args: str):
|
||||
unpaper_args = shlex.split(args)
|
||||
if any('/' in arg for arg in unpaper_args):
|
||||
if any(('/' in arg or arg == '.' or arg == '..') for arg in unpaper_args):
|
||||
raise ValueError('No filenames allowed in --unpaper-args')
|
||||
return unpaper_args
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user