Trustwave Unveils New Offerings to Maximize Value of Microsoft Security Investments. Learn More

Trustwave Unveils New Offerings to Maximize Value of Microsoft Security Investments. Learn More

Services
Capture
Managed Detection & Response

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

twi-managed-portal-color
Co-Managed SOC (SIEM)

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

twi-briefcase-color-svg
Advisory & Diagnostics

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

tw-laptop-data
Penetration Testing

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

twi-database-color-svg
Database Security

Prevent unauthorized access and exceed compliance requirements.

twi-email-color-svg
Email Security

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

tw-officer
Digital Forensics & Incident Response

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

tw-network
Firewall & Technology Management

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

Solutions
BY TOPIC
Offensive Security
Solutions to maximize your security ROI
Microsoft Exchange Server Attacks
Stay protected against emerging threats
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
SpiderLabs Blog

I Forgot Your Password

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.

Latest SpiderLabs Blogs

Clockwork Blue: Automating Security Defenses with SOAR and AI

It’s impractical to operate security operations alone, using manual human processes. Finding opportunities to automate SecOps is an underlying foundation of Zero Trust and an essential architecture...

Read More

Professional Services Sector Under Attack - Trustwave SpiderLabs Report 2024

Recent research by Trustwave SpiderLabs, detailed in their newly published report "2024 Professional Services Threat Landscape: Trustwave Threat Intelligence Briefing and Mitigation Strategies,"...

Read More

Atlas Oil: The Consequences of a Ransomware Attack

Overview Atlas Oil, a major player in the oil and fuel distribution industry, fell victim to a ransomware attack orchestrated by the Black Basta group. This attack not only compromised sensitive...

Read More