From 6a832a4104f2da3985f605e9bb973591f19d30f7 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 6 Jun 2018 23:50:25 +0200 Subject: Prevent exiftool-based parameter-injection --- tests/test_libmat2.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/test_libmat2.py') diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py index 89a5811..84eb75e 100644 --- a/tests/test_libmat2.py +++ b/tests/test_libmat2.py @@ -17,6 +17,16 @@ class TestParserFactory(unittest.TestCase): self.assertEqual(parser.__class__, audio.MP3Parser) +class TestParameterInjection(unittest.TestCase): + def test_ver_injection(self): + shutil.copy('./tests/data/dirty.png', './-ver') + p = images.PNGParser('-ver') + meta = p.get_meta() + self.assertEqual(meta['Comment'], 'This is a comment, be careful!') + self.assertEqual(meta['ModifyDate'], "2018:03:20 21:59:25") + os.remove('-ver') + + class TestUnsupportedFiles(unittest.TestCase): def test_pdf(self): shutil.copy('./tests/test_libmat2.py', './tests/clean.py') -- cgit v1.3