Skip to main content
Menu
Advisories

Login OAuth creates predictable local credentials for OAuth-provisioned accounts

GHSA-MJ8V-HVF6-73GMPublished Updated GitHub

Description

grav-plugin-login-oauth provisions an ordinary Grav account for a provider identity using a deterministic local username and a local password derived as the unsalted MD5 hash of the provider identifier. Provider identifiers are identifiers rather than secrets and may be public or guessable. The generated local credential can therefore be reproduced without completing the OAuth flow.

Affected versions

Versions 1.0.0-beta.1 through 1.4.2 contain the vulnerable credential derivation.

Details

The plugin constructs the local username from the provider name and provider identifier. It assigns md5(provider_identifier) as the account password during registration and computes the same value when an existing OAuth identity returns. The resulting account is registered as a normal Grav user, with no provider-only marker that disables password authentication.

Impact

An unauthenticated attacker who learns or guesses an affected account's provider identifier can reproduce its local username and password and authenticate as that account through normal password login. The resulting privileges are those assigned to the OAuth-provisioned account; takeover of an administrative OAuth account can yield administrative control.

Patches

Upgrade to Login OAuth 1.4.3 when it is released.

The fix stops generating derived credentials, marks provider-provisioned accounts with an explicit provider identity, and refuses local password authentication for them — including accounts created before the marker existed, which are recognized by the <provider>.<id> username pattern against the configured provider names, so existing derived passwords stop being usable without waiting for each account holder to return. Provider sign-in no longer authenticates the derived password at all; identity comes from the verified provider callback. Disabled-account checks are preserved and an account requiring a second factor fails closed.

Operators who cannot upgrade immediately can disable the plugin, or change the password of any account named <provider>.<id>.

Credits

Reported by @AlpetGexha.

Affected versions

References

GitHub · getgrav/grav