Skip to content

Key value parsing in VerifyAssertionAsync is not strictly correct #143

@xPaw

Description

@xPaw

While looking at the implementation, I noticed that response parsing will skip any lines that have more than one colon, specifically here:

for (var line = await reader.ReadLineAsync(); line != null; line = await reader.ReadLineAsync())
{
var parameter = line.Split(':');
if (parameter.Length != 2)
{
continue;
}

As a result, a line ns:http://specs.openid.net/auth/2.0 will be skipped.

The specification says that a key or value MUST NOT contain a newline and a key also MUST NOT contain a colon. Notice that it does not say that values can't contain a colon.

Furthermore, the ns is not validated, but it should be present in the response according to the specification:

ns
Value: "http://specs.openid.net/auth/2.0"
This particular value MUST be present for the response to be a valid OpenID 2.0 response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions