In the world of web security, finding vulnerabilities within a web application is a rewarding yet challenging process. Recently, I had the opportunity to test the security of Burger King's online ordering system. During my penetration testing, I was able to bypass their Web Application Firewall (WAF) and discovered a critical SQL injection vulnerability using their order ID.
SQL injection is a technique where an attacker can manipulate an SQL query by injecting malicious code into the input fields or URL parameters. This can allow attackers to retrieve, modify, or delete data from the backend database. I suspected that the order ID parameter might be vulnerable to SQL injection, so I began testing it with various payloads.
First, I injected a simple single quote (`'`) into the order ID field, which is a common test for SQL injection. To my surprise, the system didn’t show any errors, but it did return unexpected results that hinted at the possibility of an underlying vulnerability.
Next, I tried more sophisticated SQL injection payloads like:
' OR 1=1 --
This payload is used to bypass login mechanisms and can sometimes trick the database into returning all records by altering the SQL query logic. I sent this payload through the order ID parameter, and it triggered unexpected database responses that confirmed the presence of SQL injection.
Burger King's WAF was designed to block typical SQL injection attempts by filtering out certain special characters and keywords (like `OR`, `1=1`, `--`, etc.). However, as is often the case, WAFs can be bypassed by using encoding or obfuscation techniques. I employed a few strategies to evade the WAF’s detection, including:
With these techniques, I successfully bypassed the WAF, allowing the malicious SQL query to reach the backend server and execute.
Once I bypassed the WAF, I was able to inject the SQL query and retrieve data from the backend database. For example, by modifying the payload to:
' UNION SELECT username, password FROM users --
This query would allow me to extract sensitive information from the users' table in the database. The vulnerability gave me unauthorized access to the backend, allowing me to interact with data that should have been protected.
However, I did not exploit the vulnerability further. Instead, I immediately reported it to Burger King’s security team through their responsible disclosure program.
After reporting the vulnerability, Burger King responded quickly, acknowledging the issue and thanking me for my responsible disclosure. As a token of appreciation for helping to secure their platform, they rewarded me with Rs 2500 worth of Burger King tokens.
While the reward was appreciated, the real satisfaction came from knowing that my discovery would help make their platform safer for customers.
Bypassing Burger King's WAF and exploiting the SQL injection vulnerability via the order ID was an exciting yet eye-opening experience. It highlighted both the strengths and limitations of security systems and reinforced the importance of continuous testing and improvement.
As penetration testers, our role is not just to identify vulnerabilities but also to help organizations strengthen their defenses. Thanks to my work, Burger King was able to patch this vulnerability, ensuring a safer experience for its users.
This journey was an important reminder of why ethical hacking and responsible bug disclosure are crucial in the fight to make the web a safer place for everyone.