lixin-wei / HZNUOJ

Hangzhou Normal University Online Judge

Home Page:http://acm.hznu.edu.cn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strict SQL filtering leads to xss injection vulnerability

plr47 opened this issue · comments

description

The code problem occurred in OJ / admin-tools / cal_scores.php. The $ realname in the output form was obtained from the database. There was no filtering of angle brackets “<>” during registration, which caused the reorganization here. xss injection

image-20200225160853304

Attack process

First register an account on the /OJ/modifypage.php page,Class is "软工163",Real Name is 
<details open ontoggle=['yds_is_so_handsome'].find(\u0070rompt)>

image-20200225162702052

Then visit / OJ / admin-tools / cal_scores.php, set the classList to soft 软工163, and click submit

image-20200225162722101

the attack works

image-20200225162808498

poc

<details open ontoggle=['yds_is_so_handsome'].find(\u0070rompt)>

hi @plr47 I've fixed it in commit 51a18c5

thanks.