@@ -168,7 +168,7 @@ def test_django_tainted_user_agent_iast_disabled(client, test_spans, tracer):
168168
169169@pytest .mark .django_db ()
170170@pytest .mark .skipif (not asm_config ._iast_supported , reason = "Python version not supported by IAST" )
171- def test_django_tainted_user_agent_iast_enabled_sqli_http_request_parameter (client , test_spans , tracer ):
171+ def test_django_sqli_http_request_parameter (client , test_spans , tracer ):
172172 root_span , response = _aux_appsec_get_root_span (
173173 client ,
174174 test_spans ,
@@ -309,6 +309,46 @@ def test_django_sqli_http_request_parameter_name_post(client, test_spans, tracer
309309 assert loaded ["vulnerabilities" ][0 ]["hash" ] == hash_value
310310
311311
312+ @pytest .mark .django_db ()
313+ @pytest .mark .skipif (not asm_config ._iast_supported , reason = "Python version not supported by IAST" )
314+ def test_django_sqli_query_no_redacted (client , test_spans , tracer ):
315+ root_span , response = _aux_appsec_get_root_span (
316+ client ,
317+ test_spans ,
318+ tracer ,
319+ url = "/appsec/sqli_query_no_redacted/?q=sqlite_master" ,
320+ )
321+
322+ vuln_type = "SQL_INJECTION"
323+
324+ assert response .status_code == 200
325+ assert response .content == b"OK"
326+
327+ loaded = json .loads (root_span .get_tag (IAST .JSON ))
328+
329+ line , hash_value = get_line_and_hash ("sqli_query_no_redacted" , vuln_type , filename = TEST_FILE )
330+
331+ assert loaded ["sources" ] == [
332+ {
333+ "name" : "q" ,
334+ "origin" : "http.request.parameter" ,
335+ "value" : "sqlite_master" ,
336+ }
337+ ]
338+
339+ assert loaded ["vulnerabilities" ][0 ]["type" ] == vuln_type
340+ assert loaded ["vulnerabilities" ][0 ]["evidence" ] == {
341+ "valueParts" : [
342+ {"value" : "SELECT * FROM " },
343+ {"source" : 0 , "value" : "sqlite_master" },
344+ {"value" : " ORDER BY name" },
345+ ]
346+ }
347+ assert loaded ["vulnerabilities" ][0 ]["location" ]["path" ] == TEST_FILE
348+ assert loaded ["vulnerabilities" ][0 ]["location" ]["line" ] == line
349+ assert loaded ["vulnerabilities" ][0 ]["hash" ] == hash_value
350+
351+
312352@pytest .mark .django_db ()
313353@pytest .mark .skipif (not asm_config ._iast_supported , reason = "Python version not supported by IAST" )
314354def test_django_sqli_http_request_header_value (client , test_spans , tracer ):
0 commit comments