T13nn3s / Invoke-SpfDkimDmarc

PowerShell Module for checking SPF, DKIM and DMARC-record.
https://binsec.nl/powershell-script-for-spf-dmarc-and-dkim-validation/
MIT License
43 stars 8 forks source link

Get-DMARCRecord potentially gives back incorrect result #19

Closed gavsto closed 1 year ago

gavsto commented 2 years ago

I've actually been writing a similar project elsewhere and a friend linked me to yours.

On Line 53 you are doing a regex switch for p=reject. Unfortunately, sp=reject is also a valid tag so your switch can potentially trigger even if DMARC is not set to reject. Just thought I'd let you know.

T13nn3s commented 2 years ago

The p= tag is active for the top-level domain and also for the subdomains unless the sp= tag is specified. The sp= tag is active only for the subdomains. I agree that the top level, the p= tag can on reject, and that the script gives a secure DMARC-record output, while the policy for the subdomain may be configured to none, which is insecure. I will write an update on the script to validate the sp= tag separately from the =p tag.

T13nn3s commented 1 year ago

Fixed in version 1.5.2