ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်
OWASP (Open Worldwide Application Security Project) က non-profit organization ပါ, Top 10 list ကို data-driven research ကနေ ၃-၄ နှစ်တစ်ခါ update လုပ်ပါတယ်။ SQL Injection က user input ကို database query ထဲ direct ထည့်ရေးလို့ attacker ကို query logic ပြောင်းခွင့်ပေးမိတဲ့ vulnerability ပါ (parameterized query ဖြင့် ကာကွယ်ရပါတယ်)။ XSS (Cross-Site Scripting) က user input ကို sanitize မလုပ်ဘဲ HTML output ထဲ ထည့်ရေးလို့, attacker ရဲ့ script code ကို victim browser ထဲ run ခွင့်ပေးမိတဲ့ vulnerability ပါ။ Broken Access Control ကတော့ authorization check ချို့ယွင်းလို့ user တစ်ယောက်က ကိုယ့်ဒေတာ မဟုတ်တဲ့ (user ID ပြောင်းရုံနဲ့ ရ) data ကို ကြည့်နိုင်တဲ့ vulnerability ပါ.
လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
DVWA (lab web app) မှာ SQL Injection page ကို `' OR '1'='1` ဆိုတဲ့ input ထည့်ကြည့်ရင် — query logic ကို ပြောင်းလဲပစ်ပြီး, login authentication ကို bypass ဖြစ်စေနိုင်တာကို directly observe နိုင်ပါတယ် — defender ဘက်က parameterized query (prepared statement) ကို သုံးရင် ဒီ vulnerability ကို လုံးဝ ကာကွယ်နိုင်ပါတယ် (user input ကို query logic အဖြစ် interpret လုပ်စေမှာ မဟုတ်ဘဲ, data value တစ်ခုတည်း အဖြစ်ပဲ ဆက်ဆံလို့).
အတူတူ ကြည့်မယ်
-- Vulnerable query (string concatenation)
SELECT * FROM users WHERE username = '" + userInput + "'
-- If userInput = "' OR '1'='1", the query becomes:
-- SELECT * FROM users WHERE username = '' OR '1'='1'
-- '1'='1' is always true — this bypasses the login check!
-- The fix: parameterized query (input treated as DATA, not code)
SELECT * FROM users WHERE username = ? -- driver binds userInput safelySQL Injection/XSS/Broken Access Control ရဲ့ root cause နှင့် defense ကို ရှင်းပြနိုင်မည်။၅ မိနစ် စမ်းကြည့်
DVWA (lab web app) ရဲ့ SQL Injection page ကို security level 'low' နဲ့ `' OR '1'='1` input စမ်းကြည့်ပါ (ကိုယ့် lab ထဲမှာသာ) — ဘယ် code change (parameterized query) က ဒီ vulnerability ကို ကာကွယ်ပေးနိုင်လဲ ရေးကြည့်ပါ။
သတိလေးတစ်ချက်
ဒီ lesson ရဲ့ SQL Injection payload ကို DVWA (lab, intentionally vulnerable) ပေါ်မှာသာ practice လုပ်ပါ — real website (ကိုယ့်ပိုင် မဟုတ်တဲ့) ပေါ်မှာ ဒီလို payload ကို input field ထဲ ထည့်စမ်းကြည့်ခြင်းသည် authorization မရှိတဲ့ system testing ဖြစ်သွားနိုင်ပြီး ဥပဒေချိုးဖောက်မှုဖြစ်ပါတယ်.