Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

CookieAuthenticationEvents.OnValidatePrincipal can result in a NullReferenceException #949

@tuespetre

Description

@tuespetre

Before OnValidatePrincipal is called by the CookieAuthenticationHandler, CheckForRefresh is called, which guards against null values for IssuedUtc and ExpiresUtc before calling RequestRefresh; however, afterwards, if ShouldRenew was set to true on the CookieValidatePrincipalContext, RequestRefresh will be called directly without any safeguards against null values:

https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNetCore.Authentication.Cookies/CookieAuthenticationHandler.cs#L131

When this bug is encountered, it results in failure of any exception/diagnostics handlers and the user seeing a blank page.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions