aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_parse.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_parse.py')
-rw-r--r--tests/test_parse.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index 28c8609..a29b7a1 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -213,12 +213,20 @@ class TestIocAssembly(unittest.TestCase):
def test_no_ioc_holds_a_recipient_address(self):
# The safety property, asserted over the whole output.
for name in ("simple.eml", "forged-chain.eml", "with-attachment.eml",
- "redirector.eml"):
+ "redirector.eml", "leaky.eml"):
iocs = parse.iocs(load(name), trusted=["192.0.2.0/24"])
blob = repr(iocs)
self.assertNotIn("you@example.org", blob)
self.assertNotIn("example.org", blob)
+ def test_the_address_does_not_survive_any_url_shape(self):
+ # leaky.eml carries you@example.org in five placements. Each one has
+ # been a real leak in this codebase or is one shape away from it.
+ iocs = parse.iocs(load("leaky.eml"), trusted=["192.0.2.0/24"])
+ blob = repr(iocs)
+ self.assertNotIn("you@example.org", blob)
+ self.assertNotIn("you%40example.org", blob)
+
if __name__ == "__main__":
unittest.main()