Trustwave and Cybereason Merge to Form Global MDR Powerhouse for Unparalleled Cybersecurity Value. Learn More

Trustwave and Cybereason Merge to Form Global MDR Powerhouse for Unparalleled Cybersecurity Value. Learn More

Services
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Microsoft Security
Unlock the full power of Microsoft Security
Offensive Security
Solutions to maximize your security ROI
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats

I'm now going into my second year in application security, and as I learn more and more, my favorite attacks are still some of the things I learned when I first began here in SpiderLabs. For example, using an application's "forgot password" functionality to hijack user accounts and be very rewarding and oftentimes yields critical information.

So let's dive in. Here's an example of how I might retrieve your password when I've "forgotten" it.

This is by far the most common mistake I see.

12550_ee655180-d9b3-4150-ba74-3e34230c6c78

On the surface, this looks pretty good. You're not sending the user their password in plaintext. They have to use the forgot password form to generate an e-mail with a tokenized link. Using an invalid token will render the page useless, and maybe it even only has a 30-minute time limit before the token expires.

My general approach is to self-register an account as User1, and then send myself a forgot password e-mail. However, while the token must be valid, what is oftentimes overlooked is whether or not the token has been specifically tied to my user. Let's say I copy the URL and make a slight modification:

8955_4349049f-0df3-4419-9121-225749e7688d

And here we are, it now asks me to set a new password for User2. I change the password to 'password1', submit, and proceed to login to my new account.

Another variation of this is even more interesting. Let's say after modifying the URL, I receive this page:

12525_ed602539-7990-4fde-8eea-d27d3ed8588b

While this big, scary error message may deter some, I've seen instances where the application recognizes that something is amiss, but still allows an attacker to continue.

8848_3d310496-11f9-4345-becc-50c72d05cc3aThis looks bad. But if I try my new password…

7820_09f49e1a-a558-42db-bc8b-025180cfcbe8

There are a few steps we could take to remediate this vulnerability. First, the developers can tie the token to the user account. The error message implied that the developers started to do that, but didn't enforce it properly. The developers should also remove the username from the process altogether, by sending a link that only includes a token and matches it to the correct username on the server-side. Lastly, while error messages can serve many purposes, security should not be one of them. Double-check your code to make sure that it's not only verifying that the two parameters match, but that the process is stopped if they do not. Any good attacker, or pentester, will follow the process through regardless of what the application tells him or her, just to see what happens.

One of my favorite things about hijacking user accounts is that vulnerabilities present in user-management portions of the application suddenly become critical issues. If your application doesn't mask a user's credit card number or SSN on a "My Account" page, it's bad practice. If I can log into your account, it becomes a serious vulnerability. Even if information is masked properly, if the application allows you store your billing information, I don't need it in order to buy myself something nice. A wealth of other information is also suddenly opened up to an attacker if they can hijack user accounts. Your customer's names, addresses, phone numbers, purchase histories, and possibly even medical information, are suddenly available for the curious and malicious alike.

ABOUT TRUSTWAVE

Trustwave is a globally recognized cybersecurity leader that reduces cyber risk and fortifies organizations against disruptive and damaging cyber threats. Our comprehensive offensive and defensive cybersecurity portfolio detects what others cannot, responds with greater speed and effectiveness, optimizes client investment, and improves security resilience. Learn more about us.

Latest Intelligence

Discover how our specialists can tailor a security program to fit the needs of
your organization.

Request a Demo