Identifying Vulnerability

Scenario: HTBank

White-box assessment of HTBank website. Key information:

  • Cannot create accounts with @htbank.com email addresses (admin only)

  • Source code provided


Exploration

1. Registration

Register test account: pentest@test.com:pentest

Note: Lack of password policy (pentest allowed as password) signifies security weakness.

2. Settings Page

Found /settings with:

  • Update username, email, password, profile picture

  • Import/Export Settings feature

3. Export Settings

Clicking "Export Settings" produces Base64 string:

Output:

This is a serialized PHP object!


Source Code Analysis

Laravel application. Find the function:

Vulnerable Code

Vulnerability Analysis

  1. Server accepts serialized UserSettings object

  2. No filters or checks on the string before unserialize()

  3. User details updated based on deserialized object values


Key Takeaways

Note: Import and export of settings or progress are very popular, especially in games. Always keep an eye out for these features as they may be vulnerable if not properly secured.

Finding unserialize()


Attack Surface

The vulnerability allows:

  1. Object Injection - Modify serialized user data

  2. Potential privilege escalation via email manipulation

  3. Possible RCE if magic methods exist

Last updated