| 제목 | code-projects Simple Cafe Ordering System published October 30, 2025 SQL Injection |
|---|
| 설명 | Vulnerability Overview:
The application concatenates $_POST/$_GET values directly into SQL strings and uses the deprecated mysql_* API to execute queries. This pattern appears across multiple endpoints (login, registration, order submission, search) and results in classic SQL injection vulnerabilities.
Root Cause:
User-supplied input is inserted into SQL statements without server-side validation or parameterization. The codebase relies on legacy mysql_* functions that do not support prepared statements, so untrusted values are interpreted as SQL.
Exploitability & Impact:
An attacker can exploit these injection points to bypass authentication (login), read arbitrary database rows/columns, and manipulate business logic (e.g., create or modify orders). If the database account has high privileges, data modification or deletion is also possible.
Proof-of-Concept (brief):
POST username=admin' OR '1'='1' -- to the login endpoint (with any password). If the application authenticates the request (redirects, sets session), SQL injection is confirmed. Alternatively, inject boolean tests (e.g., product_id=1' AND 1=2 --) and observe response differences.
Mitigation Summary:
Replace mysql_* usage with PDO or mysqli and use prepared statements with bound parameters. Validate and whitelist inputs (types, lengths, formats), centralize DB access into a safe data layer, and use least-privilege database credentials. Add logging and monitoring to detect suspicious query patterns.
Short tagline: Direct string concatenation of client input into SQL + legacy mysql_* usage = easily exploitable SQL injection — fix by parameterizing queries and validating inputs. |
|---|
| 원천 | ⚠️ https://github.com/shenxianyuguitian/cafeorder_vuln_SQL/blob/main/README.md |
|---|
| 사용자 | xuanyuesanshi (UID 88126) |
|---|
| 제출 | 2025. 10. 30. AM 09:23 (11 개월 ago) |
|---|
| 모더레이션 | 2025. 11. 14. PM 05:24 (15 days later) |
|---|
| 상태 | 수락 |
|---|
| VulDB 항목 | 332499 [code-projects Simple Cafe Ordering System 1.0 /login.php username SQL 주입] |
|---|
| 포인트들 | 20 |
|---|