
Tech • AI • Robotics • Game
⏱ ≈ 3 min read · 7-min video — 4 min saved
A test scan of a small online store uncovered three critical web vulnerabilities—SQL injection, path traversal, and cross-site scripting—showing how untrusted user input can expose hidden data, server files, and browser sessions.
A security scan using ZAP completed in about 90 seconds and flagged three high-risk issues in the store application: SQL injection, path traversal, and cross-site scripting. The application included a search feature, an invoice download page, and a review form, and each of those functions mapped directly to one of the vulnerabilities.
The application published an /openapi.json file listing its available endpoints and expected inputs. Such documentation helps developers integrate with an app, but it also gives attackers a clear map of where to probe. ZAP used that same specification to drive an active scan, automatically sending malicious test inputs to each route.
Unlike passive scanning, which only observes traffic, active scanning submits payloads designed to trigger failures. In this case, the scanner tried a quotation mark to disrupt database queries, ../ sequences to escape folders, and HTML or script content to test browser rendering. It then analyzed the responses for signs that the application had trusted dangerous input.
The store’s search function accepted a crafted string resembling ' or 1=1 --. That input terminated the original search term, added a condition that is always true, and used the comment marker to suppress the remainder of the database query. As a result, the application revealed a hidden, unreleased product called NextG AI Gateway, marked confidential.
The invoice feature was intended to fetch files such as invoice_101.txt, but it failed to restrict the requested path. By repeatedly using ../, an attacker could move up the directory tree and request the server’s /etc/passwd file. That file does not typically contain passwords on modern systems, but it does expose local account information and confirms unauthorized access to the host file system.
The reviews page rendered user input directly in a preview. A malicious payload using an image tag with a broken source and an onerror handler triggered a browser alert, demonstrating cross-site scripting. In practice, the same flaw could be used to steal session data or run actions in another user’s browser.
The database, file system, and browser each received raw user input without proper controls. That common pattern is a core cause of many web attacks and aligns closely with risks highlighted by the OWASP Top 10, a widely used industry reference for common application security failures.
The search flaw was fixed with parameterized queries, ensuring user input is treated as data rather than executable SQL. The file download issue was mitigated with os.path.basename, stripping directory traversal elements from filenames. The review flaw was closed with html.escape, converting special characters into safe text so the browser displays them instead of executing them.
Developers also disabled an exposed debug page and added the missing security headers flagged during scanning. After the changes, the same three attack attempts no longer succeeded, and a repeat scan reported zero serious problems.
The scan was designed to run automatically in a CI/CD pipeline such as GitHub Actions or GitLab CI. A rules file defined which findings should fail the build. When the fixed application was scanned again, ZAP returned an exit code of 0, allowing deployment to proceed only after the critical issues had been eliminated.
The case shows how ordinary web features can become high-impact attack paths when applications trust user input by default. Automated scanning and basic defensive coding can prevent those flaws from reaching production.
Ask a question