mirror of
https://github.com/github/codeql.git
synced 2025-12-24 12:46:34 +01:00
Unit tests move and temporary ql
This commit is contained in:
3
python/ql/src/experimental/Security/CWE-079/test.ql
Normal file
3
python/ql/src/experimental/Security/CWE-079/test.ql
Normal file
@@ -0,0 +1,3 @@
|
||||
select "1"
|
||||
// void query to run and generate unit_tests.testproj database to test
|
||||
// until we decide the objective of the query
|
||||
@@ -0,0 +1 @@
|
||||
| 1 |
|
||||
@@ -0,0 +1 @@
|
||||
experimental/Security/CWE-079/test.ql
|
||||
@@ -1,14 +0,0 @@
|
||||
# This tests that the user doesn't pass user-tainted data into the msg.html attribute.
|
||||
# source: https://pythonhosted.org/Flask-Mail/
|
||||
from flask_mail import Message
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
|
||||
msg = Message("Hello",
|
||||
sender="from@example.com",
|
||||
recipients=["to@example.com"])
|
||||
|
||||
msg.html = "<b>testing</b>"
|
||||
|
||||
mail.send(msg)
|
||||
@@ -1,14 +0,0 @@
|
||||
# This tests that the user doesn't pass user-tainted data into the msg html initialized argument.
|
||||
# source: https://pythonhosted.org/Flask-Mail/
|
||||
|
||||
from flask_mail import Message
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
|
||||
msg = Message("Hello",
|
||||
sender="from@example.com",
|
||||
recipients=["to@example.com"],
|
||||
html="<b>testing</b>")
|
||||
|
||||
mail.send(msg)
|
||||
@@ -1,16 +0,0 @@
|
||||
# This tests that the user can't send multiple vulnerable emails.
|
||||
# source: https://pythonhosted.org/Flask-Mail/
|
||||
|
||||
from flask_mail import Message
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
with mail.connect() as conn:
|
||||
for user in users:
|
||||
message = '...'
|
||||
subject = "hello, %s" % user.name
|
||||
msg = Message(recipients=[user.email],
|
||||
html=message,
|
||||
subject=subject)
|
||||
|
||||
conn.send(msg)
|
||||
Reference in New Issue
Block a user