{'context_id': 478, 'vulnerable': True, 'processing': False, 'request': {'url': 'https://www.perez.org/postscategory.html', 'method': 'PUT', 'headers': {'HOST': '127.0.0.1:5000', 'USER_AGENT': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0', 'ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'ACCEPT_LANGUAGE': 'en-US,en;q=0.5', 'ACCEPT_ENCODING': 'gzip, deflate, br, zstd', 'REFERER': 'http://127.0.0.1:5000/xss/stored', 'ORIGIN': 'http://127.0.0.1:5000', 'CONNECTION': 'keep-alive', 'COOKIE': 'csrftoken=7GgBqVlBL6WuGdfu3e6EBXep8N5vFiVm; grafana_session=54c841e9cb2f4956a7c791efd284d120; grafana_session_expiry=1735995560; user_id=2; session_token=b3c634c91e1711c794704a031918a34b', 'UPGRADE_INSECURE_REQUESTS': '1', 'SEC_FETCH_DEST': 'document', 'SEC_FETCH_MODE': 'navigate', 'SEC_FETCH_SITE': 'same-origin', 'SEC_FETCH_USER': '?1', 'PRIORITY': 'u=0, i', 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_9_3 rv:5.0; iw-IL) AppleWebKit/534.15.6 (KHTML, like Gecko) Version/5.0.3 Safari/534.15.6'}, 'body': b'csrfmiddlewaretoken=e9aa08a1-1568-4f08-bbbc-e821c953f9d3&newpass1=ODlFEbnQ&newpass2=kGVMtzKT'}, 'control_flow': {0: "api_key = request.cookies.get('api_key')", 1: 'if API_KEY is None or api_key == API_KEY:', 2: 'return f(*args, **kwargs)', 3: 'pass', 4: "if request.method == 'GET':", 5: 'return xss_stored_api(request, app)', 6: "message = request.form['message']", 7: "result = app.db_helper.execute_write('INSERT INTO messages (message) VALUES (:msg)', { 'msg': message })", 8: 'con = None', 9: 'try:', 10: 'con = self._get_db_connection()', 11: 'return sqlite3.connect(self.DB_FILE_PATH)', 12: 'cur = con.cursor()', 13: 'result = cur.execute(sql, params)', 14: 'con.commit()', 15: 'return result', 16: 'if con is not None:', 17: 'con.close()', 18: 'return result', 19: 'return xss_stored_page(request, app)', 20: "messages = app.db_helper.execute_read('SELECT * FROM messages', {})", 21: 'con = None', 22: 'try:', 23: 'con = self._get_db_connection()', 24: 'return sqlite3.connect(self.DB_FILE_PATH)', 25: 'cur = con.cursor()', 26: 'cur.execute(sql, params)', 27: 'result = cur.fetchall()', 28: 'return result', 29: 'if con is not None:', 30: 'con.close()', 31: 'return result', 32: 'messages = list(map(lambda it: it[0], messages))', 33: 'messages = list(map(lambda it: it[0], messages))', 34: 'messages = list(map(lambda it: it[0], messages))', 35: 'messages = list(map(lambda it: it[0], messages))', 36: "return render_template('xss-stored.html', messages=messages)", 37: '', 38: '<div class="block">', 39: '', 40: '<form action="/xss/stored" method="post">', 41: '<label class="label">Name</label>', 42: '<div class="control">', 43: '<input class="input" type="text" placeholder="Text input" id="message" name="message" required minlength="3">', 44: '<div class="control">', 45: '<input class="input" type="text" placeholder="Text input" id="message" name="message" required minlength="3">', 46: '<div class="control">', 47: '</div>', 48: '<meta name="viewport" content="width=device-width, initial-scale=1.0">', 49: '<link rel="stylesheet" href="{{ url_for(\'static\', filename=\'assets/bulma.min.css\') }}">', 50: '<title>Vuln Python App</title>', 51: '<body>', 52: '{% include "./components/navbar.html" %}', 53: '<section class="section">', 54: '{% block content %}{% endblock %}', 55: '</div>', 56: '</section>', 57: '', 58: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 59: '', 60: '<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="False" data-target="navbarBasicExample">', 61: '<span aria-hidden="True"></span>', 62: '<span aria-hidden="True"></span>', 63: '</div> -->', 64: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 65: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 66: '', 67: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 68: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 69: '<div id="navbarBasicExample" class="navbar-menu">', 70: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 71: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 72: '<div class="navbar-start">', 73: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 74: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 75: '<a class="navbar-item" href="{{ url_for(\'home\') }}">', 76: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 77: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 78: 'Home', 79: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 80: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 81: '</a>', 82: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 83: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 84: '', 85: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 86: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 87: '<div class="navbar-item has-dropdown is-hoverable">', 88: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 89: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 90: '<a class="navbar-link">', 91: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 92: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 93: 'SQL Injection', 94: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 95: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 96: '</a>', 97: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 98: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 99: '', 100: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 101: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 102: '<div class="navbar-dropdown">', 103: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 104: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 105: '<a class="navbar-item" href="{{ url_for(\'sql_injection_login\') }}">', 106: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 107: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 108: 'Login', 109: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 110: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 111: '</a>', 112: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 113: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 114: '<a class="navbar-item" href="{{ url_for(\'sql_injection_search\') }}?q=">', 115: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 116: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 117: 'Search', 118: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 119: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 120: '</a>', 121: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 122: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 123: '</div>', 124: '<script src="{{ url_for(\'static\', filename=\'assets/global.js\') }}"></script>', 125: '<script src="{{ url_for(\'static\', filename=\'assets/axios.min.js\') }}"></script>', 126: '<script>', 127: "// var googleCaptchaKey = '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI';", 128: '<div class="control">', 129: '<button class="button is-link" type="submit">Submit</button>', 130: '</div>', 131: '</form>', 132: '', 133: '<div class="block">', 134: '<h2 class="subtitle">Messages</h2>', 135: '<div class="content">', 136: '{% autoescape False %}', 137: '{% for msg in messages %}', 138: '<article class="message">', 139: '{{ msg }}', 140: '</div>', 141: '</article>', 142: '{% for msg in messages %}', 143: '<article class="message">', 144: '{{ msg }}', 145: '</div>', 146: '</article>', 147: '{% for msg in messages %}', 148: '<article class="message">', 149: '{{ msg }}', 150: '</div>', 151: '</article>', 152: '{% for msg in messages %}', 153: '{% endfor %}', 154: '{% endautoescape %}', 155: '</div>', 156: '</div>', 157: '</section>', 158: "// var googleCatpchaSecretKey = '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe';", 159: '', 160: "var googleCaptchaKey = '{{ GOOGLE_RECAPTCHA_SITE_KEY }}';", 161: "var googleCatpchaSecretKey = '{{ GOOGLE_RECAPTCHA_SECRET_KEY }}';", 162: '', 163: '</script>', 164: '', 165: '{% block js %}{% endblock %}', 166: '</body>', 167: '</html>', 168: 'None', 169: 'None', 170: 'None', 171: 'None', 172: 'None', 173: '</html>'}, 'response': {'status_code': '400', 'headers': {'Content-Type': 'text/html; charset=utf-8', 'Content-Length': '4350'}}}