Skip to content

Unsafe email/name resolution in the aspnet-contrib Apple provider

High
kevinchalet published GHSA-3893-h8qg-6h5f Aug 31, 2022

Package

nuget AspNet.Security.OAuth.Apple (NuGet)

Affected versions

>= 2.1.1-preview, <= 2.2.2
>= 3.0.0, < 3.1.8
>= 5.0.0, <= 5.0.18
>= 6.0.0, < 6.0.10

Patched versions

3.1.8
6.0.10

Description

Impact

As encouraged by Apple's non-standard OpenID Connect implementation, the aspnet-contrib Apple provider for ASP.NET Core extracts the email address and the first/last name of the logged in user from a special user parameter that is directly returned as part of the authorization response. These values are then used to populate the ClaimTypes.Email, ClaimTypes.GivenName and ClaimTypes.Surname claims that are added to the resulting ClaimsPrincipal instance.

Unfortunately, this parameter is not cryptographically signed and can be easily tampered with by an attacker to inject any forged value. While the email address returned by an external provider should never be used as a lookup identifier, applications doing so could be at risk and may be vulnerable to elevation of privilege attacks.

Patches

This vulnerability has been patched in 3.1.8 and 6.0.10 by removing built-in support for the non-standard user parameter. Other versions are no longer supported and won't receive fixes.

After applying the fix, developers are encouraged to review their use of these claims and ensure their applications were not targeted by an attacker.

Note: due to an Apple limitation, the ClaimTypes.GivenName and ClaimTypes.Surname claims will no longer be populated after migrating to a patched version.

Workarounds

While patching remains the recommended action, this security issue can be worked around by removing any use of the ClaimTypes.Email, ClaimTypes.GivenName and ClaimTypes.Surname claims or avoiding any security-sensitive decision based on their values.

References

For more information, visit #713.

Acknowledgments

Special thanks to Roy Zhang for his report.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
None
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N

CVE ID

No known CVE

Weaknesses

No CWEs

Credits