Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to parse ARC-Authentication-Results header when header.d contains a '/' #518

Closed
The-Nutty opened this issue Nov 6, 2019 · 1 comment
Labels
compatibility Compatibility with existing software

Comments

@The-Nutty
Copy link

Describe the bug
I am trying to parse the ARC-Authentication-Results header on its own, however it is periodically failing on ARC-Authentication-Results headers and i believe the cause is a '/' in the header.d see example.

Platform (please complete the following information):

  • OS: Tested on windows and amazon linux
  • .NET Framework: .NET core 2.1
  • MimeKit Version: 2.4.0

To Reproduce
Steps to reproduce the behavior:

  1. Run a console app with the following main method
        static void Main(string[] args)
        {
            if (AuthenticationResults.TryParse(
                Encoding.UTF8.GetBytes(
                    "i=2; test.com; dkim=pass header.d=test.com header.s=selector1 header.b=Iww3/TIUS; dmarc=pass (policy=reject) header.from=test.com; spf=pass (test.com: domain of [email protected] designates 1.1.1.1 as permitted sender) [email protected]"),
                out var parsedAuthenticationResult))
            {
                Console.WriteLine("Parsed auth results");

            }
            else
            {
                Console.WriteLine("Failed to parse auth results");
            }

            Console.ReadLine();
        }
  1. Run the app.

Expected behavior
The application should print Parsed auth results to console, instead it prints Failed to parse auth results.

jstedfast added a commit that referenced this issue Nov 6, 2019
@jstedfast
Copy link
Owner

You are correct... The / character is one of the tspecials that is not allowed in a property value.

pvalue := [CFWS] ( value / [ [ local-part ] "@" ] domain-name ) [CFWS]
value  := token / quoted-string
token  := 1*<any (US-ASCII) CHAR except SPACE, CTLs, or tspecials>
tspecials :=  "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "\" / <"> / "/" / "[" / "]" / "?" / "="

I changed the code to allow '/' since it is a base64 character and I don't think it'd hurt to allow it.

@jstedfast jstedfast added the compatibility Compatibility with existing software label Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with existing software
Projects
None yet
Development

No branches or pull requests

2 participants