It's my pleasure to post this guest blog from my colleague and fellow security professional, Khash Kiani, about an interesting design flaw in Yahoo! Mail.
The ultimate goal of this exercise was to reveal a few fundamental design flaws with the authentication mechanism of Yahoo! Mail, more specifically its password reset scheme.
The exercise also intended to bring awareness to one of the most often used attack vectors of low-tech hacking: find a simple technical flaw in an application and exploit it via manual techniques. This case study illustrates how social engineers play with people's trust and utilize basic techniques to gain information about individuals; information that would ultimately be leveraged to gain unauthorized access to Yahoo! Mail accounts.
Find the weak link.
The plan for this exercise was to use one of the most fundamental tactics of social engineering: obtaining information that is mostly considered harmless, but can be leveraged to gain access to something sensitive, such as an email account. Yahoo! Mail's Forgot Password feature provided a path of least resistance for this exercise. Secret questions, one of the most common ways of resetting passwords, are just as important as the password itself; allowing the user to reset the password, and therefore act as another form of authentication.
Sarah Palin is a great example of how a hacker can use secret questions to compromise an account. Palin used a Yahoo! email address, email@example.com. But like most people, she selected an easy-to-guess question, "Where did you meet your husband?". This question was asked right after the user was presented with "What is your Birthday?" and "What is your Postal Code?" questions; all public and the majority available on her Wikipedia page.
Target: Jordan. A casual acquaintance of the attacker.
Compromise personal information to answer secret questions of Yahoo!'s forgot password feature: There are many different ways of gaining access to information needed for this exploit. Some of the options available to a social engineer can range from using the telephone or the Internet to obtain the information.
Question 1: "What town was your father born in?"
Compromise: Jordan's parents were born in Venezuela. The attacker performed a search for the largest cities in that country. The answer was the third one on the list.
Question 2: "What street did you grow up on?"
Compromise: From the free People Search Engine sites, the attacker used Zabasearch.com and typed in the name and the state and received a list of all potential addresses. The first 4 attempts failed, but the 5th one succeeded.
And that's all. Using the above information the attacker was able to reset the password and get into the email account.
Once inside the Yahoo! account, the attacker was able to fully compromise the account by changing all of Jordan's password reset information such as the secret questions, the email address where the password reset link is sent to, and even change the mobile number associated with the account.
Up the ante: Once inside target's Yahoo! account, the attacker searched for the keyword "password" and found all previous password reset links sent to this account from various sites such as MySpace, and Facebook. The attacker was then able to go to any of these sites and utilize their "forgot password feature" to reset the password via the compromised Yahoo! account.
But why stop there?
Compromise the rest: Once the attacker had compromised one email account, it was fairly easy to access the rest. Most peoples' email accounts are linked via the password reset functionality. Yahoo!, Gmail, Hotmail and others give the user the ability to add at least one additional email address where a password reset form can be sent to. So once one of Jordan's email accounts was accessed and fully compromised, the rest followed. Again, once inside, each account's password recovery questions and linked email address was replaced, preventing the target from resetting her own passwords.
Inform the target: By now the attacker has replaced Jordan's password on two of her Yahoo! accounts, Gmail account, Facebook, Myspace and Paypal. This was probably a good time to stop and inform his target about the compromise.
Elapsed time, 40 minutes. Game over.
Defense Against Retaliation
Knowing his target's personality and expertise, the attacker knew that Jordan was going to retaliate against his email accounts. So he took the following measures, in order to ensure she wasn't able to exploit him in a similar fashion:
- The attacker visited his Gmail and a few other web sites to make sure that the password reset features did not utilize his not-so-secure Yahoo! Mail account.
- The attacker strengthened his Yahoo! Mail secret questions and answers with something only he would be able to answer. For instance:
- Question: "Pwd is?"
- Answer: "A strong pass phrase"
While testing these security controls, the attacker noticed a several fundamental design flaws in Yahoo! Mail's password reset feature. Unfortunately, these issues prevented him from securing his own account.
Password Reset Flaw #1
In Yahoo! Mail, users are able to modify their secret questions via the "Update password reset info" feature. However, during the password recovery process, users are given the option to revert back to the original questions by clicking the "This is not my question" link on the "Please answer your secret question" page. As a result, you can never replace your original secret questions.
Clicking "This is not my question" displays the original secret question
What if you kept the original questions, but replaced the answers with something stronger or more obscure? For instance:
- Question: "Where did you spend your honeymoon"
- Original answer: "France"
- A more secure answer: "my favorite country in Europe"
But astoundingly that is not possible due to another flaw.
Password Reset Flaw #2
In Yahoo!, when changing the answer to a secret question, the functionality is designed in such way that your new answer does not "replace" the old one; instead the new answer is added to the list.
With this issue, users end up with a collection of identical questions, and different answers where any of them will satisfy that specific question.
Basically, the original, default, insecure questions and answers were still accessible. And that's exactly how Jordan got in!
The following two screenshots demonstrate that it is impossible to strengthen the answer to an existing secret question.
There is more
With older Yahoo! Accounts, the first secret question is the account holder's registered Birthday, Country and Postal Code. Many people still maintain this set as their first secret question. Some of this information could be retrieved from social networking sites like Facebook or by performing a quick search on PeopleFinders.com or Zabasearch.com. Alternatively, the attacker can revert to basic social engineering tactics to compromise this information.
For example, a new target, Jennifer, still maintained her original default secret questions: Birthday, Country, and Postal Code; followed by "What is My Full Name?". Some basic recon about the target reveals that she lived in Tacoma at some point during her high school years. The attacker then creates an anonymous Yahoo! account with the Yahoo! ID Linda1_Tacoma.
Using a Yahoo! IM client, the attacker "Added a Contact" which Jennifer accepted. This is not guaranteed to work. If Jennifer had rejected the request, the attacker could either try again later with a different Yahoo! ID, or move on to another target.
The attacker has retrieved Jennifer's Date of Birth, a small list of Zip Codes to choose from, and her Last Name. With that information her Yahoo! account can be compromised. The attacker also used her Full Name and Location Information to compromise her Hotmail account.
Regardless of what form of communication the social engineers use to gain information from the target, they always follow a few key principles:
- Establish trust before fully engaging the target.
- Always bury the key questions among innocent ones.
- Never end the conversation after getting key questions answered.
- Don't "burn your mark". Sometimes you may need to slow down or stop asking questions altogether and try later.
After discussing these issues with Yahoo!'s security team, there seems to be one main motivation behind these design decisions: Giving the "victim" the ability to regain access to a compromised account via her "original" secret questions that the attacker has no way of changing.
These solutions could be effective for a scenario where the attacker has learned a victim's password, but not the account's secret questions. However, the unfortunate side affect of these design decisions are the flaws we have described above.
These questionable design decisions in the Password Recovery scheme highlight the importance of injecting thorough security throughout the Software Development Life Cycle (SDLC). General security best practices always encourage that security reviews and testing should be integrated throughout the SDLC. Perhaps with the proper amount of security review during the design phase, and understanding the ease of exploitation via secret questions, these issues would have been detected and addressed early on.
These exercises show us how easily someone can access another's email and other accounts that are designed in a similar fashion. As a general practice, everyone should delete old email accounts that aren't needed. Make your online presence as solid as possible, and avoid leaving online breadcrumbs all over the place. You never know who might want to cause you some headache down the road by compromising your accounts.