aboutsummaryrefslogtreecommitdiffstats
path: root/tests/preauth-plaintext/t
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2020-08-03 20:51:42 +0200
committerGuilhem Moulin <guilhem@fripost.org>2020-08-03 20:51:42 +0200
commit531e27c2dfd67b4ad600c2ad5e13e608a75f04d8 (patch)
treed669f8caf9c795d88ce3e72736157901dbcaec15 /tests/preauth-plaintext/t
parent887526e77f7a3b707c53457b076d098a1edefeb7 (diff)
parentfe5501d4bb4c7c6365ceb009ea715356cca27a50 (diff)
Merge tag 'upstream/0.5.2' into debian
Upstream version 0.5.2
Diffstat (limited to 'tests/preauth-plaintext/t')
-rw-r--r--tests/preauth-plaintext/t19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/preauth-plaintext/t b/tests/preauth-plaintext/t
new file mode 100644
index 0000000..427d57b
--- /dev/null
+++ b/tests/preauth-plaintext/t
@@ -0,0 +1,19 @@
+# Test IMAP MiTM via PREAUTH greeting
+# For background see CVE-2020-12398, CVE-2020-14093 and
+# https://gitlab.com/muttmua/mutt/commit/3e88866dc60b5fa6aaba6fd7c1710c12c1c3cd01
+
+env -i USER="remote" HOME="$HOME_remote" "$TESTDIR/imapd" & PID=$!
+trap "ptree_abort $PID" EXIT INT TERM
+
+! interimap --debug || error
+grep -Fx 'remote: ERROR: PREAUTH greeting on plaintext connection? MiTM in action? Aborting, set "STARTTLS = NO" to ignore.' <"$STDERR" || error
+! grep '^remote: C: ' <"$STDERR" || error "wrote command in MiTM'ed PREAUTH connection!"
+
+
+# Ignore the warning when STARTTLS is explicitely disabled
+echo "STARTTLS = NO" >>"$XDG_CONFIG_HOME/interimap/config"
+interimap --debug || true
+
+grep -Fx "remote: S: * STATUS INBOX (UIDNEXT 1 UIDVALIDITY 1 HIGHESTMODSEQ 1)" <"$STDERR" || error
+
+# vim: set filetype=sh :