Possibility to guess email address from gravatar image URL
The Gravatar image URL on rubygems.org is generated by taking the MD5 hash of the user's email address, which is deterministic and publicly visible. An attacker who can guess an email address can compute its MD5 hash and compare it to the hash in the Gravatar URL to confirm whether that email belongs to the user, even if the user has set their email to private.
- Disclosed after 17 months
The hash used for gravatar used in rubygems.org is a simple md5, which could allow an attacker to guess the user's email address.
https://en.gravatar.com/site/implement/hash/
https://github.com/chrislloyd/gravtastic/blob/master/lib/gravtastic.rb#L79
def gravatar_id
Digest::MD5.hexdigest(send(self.class.gravatar_source).to_s.downcase)
end
In rubygems.org, there is a setting that can make the email address private, but since the url of gravatar is public, the email address can be guessed unintentionally.
PoC
-
Start server in local
-
Create user as
[email protected] -
Confirm email address is private

confirm_private.png From the original on HackerOne -
Open the profile of the user created in the secret window and get the url of gravatar
HTML <div id="avatar-frame"> {{media:1}} </div> -
Confirm that the generated hash matches the hash in the url.
Ruby require 'digest/md5' mail = '[email protected]' puts Digest::MD5.hexdigest(mail)❯ ruby test.rb 55502f40dc8b7c769880b10874abc9d0
Impact
The email address of a user who has set the email address as private may be obtained.
There was a similar discussion about wordpress. https://www.wordfence.com/blog/2016/12/gravatar-advisory-protect-email-address-identity/
Many users seem to be affected because email addresses are now private by default. https://github.com/rubygems/rubygems.org/pull/2663/files Avoiding gravatar has too much of an impact, so I suggest that give the user the option to use gravatar (use gravatar by default).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
The email address of a user who has set it as private may be obtained.
What the attacker needed
Victim has a Gravatar-enabled profile; attacker can guess the email address
The fix
The report suggests giving users the option to use Gravatar (with Gravatar as the default), but does not state that a fix was applied.
How it was found
- Start the server locally.
- Create a user with a specific email address.
- Confirm that the email address is set to private.
- Open the user's profile in a private window and obtain the Gravatar URL.
- Compute the MD5 hash of the email address and verify it matches the hash in the URL.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When you sign up for a website, you often provide an email address. Some sites use a service called Gravatar to show a profile picture based on your email. To do this, the site creates a special code (a hash) from your email address and puts it in the image link. Because the same email always produces the same code, anyone who can guess your email can check if the code matches the one in the image link. This means that even if you set your email to private, someone might still figure it out.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.