File: t

package info (click to toggle)
interimap 0.5.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,272 kB
  • sloc: perl: 3,342; sh: 886; makefile: 110; sql: 28
file content (19 lines) | stat: -rw-r--r-- 819 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 explicitly 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=bash :