- Rename functions, variables, parameters and imports with scope-aware AST passes - Generalise Flask route and template paths to unique /route_N and tpl_N names - Replace descriptive strings with length-preserving, word-consistent msg tokens - Strip docstrings and comments - Add verification for parse validity and leaked benchmark identifiers - Include SAST prompt and expected labels
39 lines
1.4 KiB
Python
39 lines
1.4 KiB
Python
from flask import redirect as mod_1, url_for as mod_2, request as mod_3, make_response as mod_4, render_template as mod_5
|
|
from helpers.utils import escape_for_html as mod_6
|
|
|
|
def init(var_1):
|
|
|
|
@var_1.route('/route_142', methods=['GET'])
|
|
def func_283():
|
|
return func_284()
|
|
|
|
@var_1.route('/route_142', methods=['POST'])
|
|
def func_284():
|
|
var_2 = ''
|
|
import helpers.separate_request
|
|
var_3 = helpers.separate_request.request_wrapper(mod_3)
|
|
var_4 = var_3.get_query_parameter('msg00000000000002a')
|
|
if not var_4:
|
|
var_4 = ''
|
|
var_5 = ''
|
|
if var_4:
|
|
var_6 = []
|
|
var_6.append('m008')
|
|
var_6.append(var_4)
|
|
var_6.append('msg00005')
|
|
var_6.pop(0)
|
|
var_5 = var_6[0]
|
|
import base64 as mod_7
|
|
import secrets as mod_8
|
|
from helpers.utils import mysession as mod_9
|
|
var_7 = 'msg00000000000002a'[13:]
|
|
var_8 = f'msg00004{var_7}'
|
|
var_9 = f'msg0000000{var_7}'
|
|
var_10 = mod_7.b64encode(mod_8.token_bytes(32))
|
|
if var_9 in mod_9 and mod_3.cookies.get(var_9) == mod_9[var_9]:
|
|
var_2 += f'msg0007 m00b: {var_8}<br/>'
|
|
else:
|
|
mod_9[var_9] = var_10
|
|
var_2 += f'{var_8} koz m00c msg0000001 m00d msg005:{var_9} msg0c msg0d wz: {mod_9[var_9]}<br/>'
|
|
return var_2
|