Dataset Viewer
Auto-converted to Parquet Duplicate
messages
listlengths
2
2
target
stringlengths
476
2.02k
template
stringclasses
20 values
label
stringclasses
2 values
language
stringclasses
3 values
framework
stringclasses
3 values
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "page/views.py", "line": 5, "code": "request.GET.get('text', '')", "kind": "http_query" } ], "sinks": [ { "file": "page/views.py", "line": 6, "code": "escape(signature)", "kind": "httpresponse_concat", "neutralized": true, "reason": "Value is HTML-escaped ...
dj_safe_escape
safe
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/main/java/com/app/PageController.java", "line": 12, "code": "@RequestParam String text", "kind": "request_param" } ], "sinks": [ { "file": "src/main/java/com/app/PageController.java", "line": 13, "code": "return Map.of(\"label\", text);", "kind": "json_body...
sb_safe_json
safe
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "item/views.py", "line": 5, "code": "request.GET.get('value', '')", "kind": "http_query" } ], "sinks": [ { "file": "item/views.py", "line": 6, "code": "escape(status)", "kind": "httpresponse_concat", "neutralized": true, "reason": "Value is HTML-escaped fo...
dj_safe_escape
safe
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/views/ArticleView.vue", "line": 13, "code": "route.query.text", "kind": "url_query" } ], "sinks": [ { "file": "src/views/ArticleView.vue", "line": 4, "code": "v-html=\"label\"", "kind": "vue_v_html", "neutralized": false, "reason": "v-html renders its...
vue_vhtml_route
vuln
JavaScript
Vue 3
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "feedback/views.py", "line": 5, "code": "request.GET.get('user', '')", "kind": "http_query" } ], "sinks": [ { "file": "feedback/views.py", "line": 6, "code": "mark_safe(label)", "kind": "mark_safe", "neutralized": false, "reason": "mark_safe flags the stri...
dj_mark_safe
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "user/views.py", "line": 4, "code": "request.GET.get('data', '')", "kind": "http_query" } ], "sinks": [ { "file": "user/templates/user.html", "line": 2, "code": "<a href=\"{{ target }}\">", "kind": "href_attribute", "neutralized": false, "reason": "Autoesc...
dj_href_url_trap
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/main/java/com/app/ProfileController.java", "line": 12, "code": "@RequestParam String ref", "kind": "request_param" } ], "sinks": [ { "file": "src/main/java/com/app/ProfileController.java", "line": 13, "code": "return \"<h1>Hello \" + ref + \"</h1>\";", "kin...
sb_responsebody_concat
vuln
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "view/views.py", "line": 5, "code": "request.GET.get('next', '')", "kind": "http_query" } ], "sinks": [ { "file": "view/views.py", "line": 6, "code": "mark_safe(about)", "kind": "mark_safe", "neutralized": false, "reason": "mark_safe flags the string as sa...
dj_mark_safe
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "note/views.py", "line": 4, "code": "request.GET.get('value', '')", "kind": "http_query" } ], "sinks": [ { "file": "note/views.py", "line": 5, "code": "HttpResponse('<h1>Results for ' + signature + '</h1>')", "kind": "httpresponse_concat", "neutralized": fals...
dj_httpresponse_concat
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/views/MessageView.vue", "line": 11, "code": "route.query.content", "kind": "url_query" } ], "sinks": [ { "file": "src/views/MessageView.vue", "line": 3, "code": ":href=\"headline\"", "kind": "href_binding", "neutralized": false, "reason": "A bound hre...
vue_href_url
vuln
JavaScript
Vue 3
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [], "sinks": [ { "file": "src/main/resources/templates/feedback.html", "line": 4, "code": "th:text=\"${signature}\"", "kind": "thymeleaf_text", "neutralized": true, "reason": "th:text HTML-escapes the model value" } ], "vulnerable": false, "findings": [], "safe_patterns": [ { ...
sb_safe_thtext
safe
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/main/java/com/app/ContentController.java", "line": 12, "code": "@RequestParam String value", "kind": "request_param" } ], "sinks": [ { "file": "src/main/resources/templates/search.html", "line": 4, "code": "th:utext=\"${description}\"", "kind": "thymeleaf_u...
sb_thymeleaf_utext
vuln
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/components/ArticleView.vue", "line": 10, "code": "location.search", "kind": "dom_location" } ], "sinks": [ { "file": "src/components/ArticleView.vue", "line": 11, "code": "box.value.innerHTML = signature", "kind": "innerHTML", "neutralized": false, "r...
vue_innerhtml_dom
vuln
JavaScript
Vue 3
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "feedback/views.py", "line": 5, "code": "request.GET.get('user', '')", "kind": "http_query" } ], "sinks": [ { "file": "feedback/views.py", "line": 6, "code": "mark_safe(tagline)", "kind": "mark_safe", "neutralized": false, "reason": "mark_safe flags the st...
dj_mark_safe
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/main/java/com/app/PageController.java", "line": 12, "code": "@RequestParam String id", "kind": "request_param" } ], "sinks": [ { "file": "src/main/java/com/app/PageController.java", "line": 13, "code": "return Map.of(\"signature\", id);", "kind": "json_body...
sb_safe_json
safe
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/components/ShowView.vue", "line": 10, "code": "location.search", "kind": "dom_location" } ], "sinks": [ { "file": "src/components/ShowView.vue", "line": 11, "code": "box.value.innerHTML = description", "kind": "innerHTML", "neutralized": false, "reaso...
vue_innerhtml_dom
vuln
JavaScript
Vue 3
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/main/java/com/app/ProfileController.java", "line": 12, "code": "@RequestParam String value", "kind": "request_param" } ], "sinks": [ { "file": "src/main/resources/templates/profile.html", "line": 4, "code": "th:utext=\"${subject}\"", "kind": "thymeleaf_utex...
sb_thymeleaf_utext
vuln
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [], "sinks": [ { "file": "item/templates/item.html", "line": 2, "code": "{{ remark }}", "kind": "template_variable", "neutralized": true, "reason": "Django autoescapes variables in HTML body context by default" } ], "vulnerable": false, "findings": [], "safe_patterns": [ { ...
dj_safe_autoescape
safe
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/views/PostView.vue", "line": 11, "code": "route.query.name", "kind": "url_query" } ], "sinks": [ { "file": "src/views/PostView.vue", "line": 3, "code": ":href=\"summary\"", "kind": "href_binding", "neutralized": false, "reason": "A bound href accepts ...
vue_href_url
vuln
JavaScript
Vue 3
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "note/views.py", "line": 4, "code": "request.GET.get('term', '')", "kind": "http_query" } ], "sinks": [ { "file": "note/templates/note.html", "line": 2, "code": "<a href=\"{{ target }}\">", "kind": "href_attribute", "neutralized": false, "reason": "Autoesc...
dj_href_url_trap
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [], "sinks": [ { "file": "profile/templates/profile.html", "line": 2, "code": "{{ feedback }}", "kind": "template_variable", "neutralized": true, "reason": "Django autoescapes variables in HTML body context by default" } ], "vulnerable": false, "findings": [], "safe_patterns": [...
dj_safe_autoescape
safe
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "profile/views.py", "line": 5, "code": "request.GET.get('next', '')", "kind": "http_query" } ], "sinks": [ { "file": "profile/views.py", "line": 6, "code": "mark_safe(tagline)", "kind": "mark_safe", "neutralized": false, "reason": "mark_safe flags the stri...
dj_mark_safe
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/components/PostView.vue", "line": 10, "code": "location.search", "kind": "dom_location" } ], "sinks": [ { "file": "src/components/PostView.vue", "line": 11, "code": "box.value.innerHTML = comment", "kind": "innerHTML", "neutralized": false, "reason": ...
vue_innerhtml_dom
vuln
JavaScript
Vue 3
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [], "sinks": [ { "file": "src/views/RenderView.vue", "line": 3, "code": "{{ snippet }}", "kind": "vue_interpolation", "neutralized": true, "reason": "Vue mustache interpolation HTML-escapes its value" } ], "vulnerable": false, "findings": [], "safe_patterns": [ { "file": "s...
vue_safe_interp
safe
JavaScript
Vue 3
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/views/CommentView.vue", "line": 11, "code": "route.query.next", "kind": "url_query" } ], "sinks": [ { "file": "src/views/CommentView.vue", "line": 3, "code": ":href=\"caption\"", "kind": "href_binding", "neutralized": false, "reason": "A bound href ac...
vue_href_url
vuln
JavaScript
Vue 3
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/components/ViewView.vue", "line": 10, "code": "location.search", "kind": "dom_location" } ], "sinks": [ { "file": "src/components/ViewView.vue", "line": 11, "code": "box.value.innerHTML = signature", "kind": "innerHTML", "neutralized": false, "reason"...
vue_innerhtml_dom
vuln
JavaScript
Vue 3
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/main/java/com/app/MessageController.java", "line": 12, "code": "@RequestParam String text", "kind": "request_param" } ], "sinks": [ { "file": "src/main/java/com/app/MessageController.java", "line": 13, "code": "return Map.of(\"about\", text);", "kind": "jso...
sb_safe_json
safe
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/main/java/com/app/CommentController.java", "line": 12, "code": "@RequestParam String keyword", "kind": "request_param" } ], "sinks": [ { "file": "src/main/java/com/app/CommentController.java", "line": 13, "code": "return Map.of(\"remark\", keyword);", "kind...
sb_safe_json
safe
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "page/views.py", "line": 5, "code": "request.GET.get('search', '')", "kind": "http_query" } ], "sinks": [ { "file": "page/views.py", "line": 6, "code": "mark_safe(greeting)", "kind": "mark_safe", "neutralized": false, "reason": "mark_safe flags the string ...
dj_mark_safe
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [], "sinks": [ { "file": "src/main/resources/templates/item.html", "line": 4, "code": "th:text=\"${snippet}\"", "kind": "thymeleaf_text", "neutralized": true, "reason": "th:text HTML-escapes the model value" } ], "vulnerable": false, "findings": [], "safe_patterns": [ { "fi...
sb_safe_thtext
safe
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/main/java/com/app/MessageController.java", "line": 12, "code": "@RequestParam String name", "kind": "request_param" } ], "sinks": [ { "file": "src/main/java/com/app/MessageController.java", "line": 13, "code": "return Map.of(\"review\", name);", "kind": "js...
sb_safe_json
safe
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/main/java/com/app/UserController.java", "line": 12, "code": "@RequestParam String value", "kind": "request_param" } ], "sinks": [ { "file": "src/main/java/com/app/UserController.java", "line": 13, "code": "return Map.of(\"snippet\", value);", "kind": "json_...
sb_safe_json
safe
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/main/java/com/app/ContentController.java", "line": 12, "code": "@RequestParam String q", "kind": "request_param" } ], "sinks": [ { "file": "src/main/resources/templates/profile.html", "line": 4, "code": "th:utext=\"${description}\"", "kind": "thymeleaf_utex...
sb_thymeleaf_utext
vuln
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "post/views.py", "line": 5, "code": "request.GET.get('input', '')", "kind": "http_query" } ], "sinks": [ { "file": "post/views.py", "line": 6, "code": "escape(description)", "kind": "httpresponse_concat", "neutralized": true, "reason": "Value is HTML-escap...
dj_safe_escape
safe
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/views/ArticleView.vue", "line": 11, "code": "route.query.ref", "kind": "url_query" } ], "sinks": [ { "file": "src/views/ArticleView.vue", "line": 3, "code": ":href=\"summary\"", "kind": "href_binding", "neutralized": false, "reason": "A bound href acc...
vue_href_url
vuln
JavaScript
Vue 3
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "user/views.py", "line": 4, "code": "request.GET.get('user', '')", "kind": "http_query" } ], "sinks": [ { "file": "user/views.py", "line": 5, "code": "HttpResponse('<h1>Results for ' + comment + '</h1>')", "kind": "httpresponse_concat", "neutralized": false, ...
dj_httpresponse_concat
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [], "sinks": [ { "file": "src/main/resources/templates/article.html", "line": 4, "code": "th:text=\"${remark}\"", "kind": "thymeleaf_text", "neutralized": true, "reason": "th:text HTML-escapes the model value" } ], "vulnerable": false, "findings": [], "safe_patterns": [ { "...
sb_safe_thtext
safe
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "page/views.py", "line": 4, "code": "request.GET.get('ref', '')", "kind": "http_query" } ], "sinks": [ { "file": "page/templates/page.html", "line": 2, "code": "<a href=\"{{ target }}\">", "kind": "href_attribute", "neutralized": false, "reason": "Autoesca...
dj_href_url_trap
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "note/views.py", "line": 5, "code": "request.GET.get('page', '')", "kind": "http_query" } ], "sinks": [ { "file": "note/views.py", "line": 6, "code": "mark_safe(bio)", "kind": "mark_safe", "neutralized": false, "reason": "mark_safe flags the string as safe...
dj_mark_safe
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "page/views.py", "line": 5, "code": "request.GET.get('input', '')", "kind": "http_query" } ], "sinks": [ { "file": "page/views.py", "line": 6, "code": "mark_safe(review)", "kind": "mark_safe", "neutralized": false, "reason": "mark_safe flags the string as ...
dj_mark_safe
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/main/java/com/app/SearchController.java", "line": 12, "code": "@RequestParam String q", "kind": "request_param" } ], "sinks": [ { "file": "src/main/java/com/app/SearchController.java", "line": 13, "code": "return \"<h1>Hello \" + q + \"</h1>\";", "kind": "r...
sb_responsebody_concat
vuln
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "preview/views.py", "line": 4, "code": "request.GET.get('msg', '')", "kind": "http_query" } ], "sinks": [ { "file": "preview/templates/preview.html", "line": 2, "code": "<a href=\"{{ target }}\">", "kind": "href_attribute", "neutralized": false, "reason": ...
dj_href_url_trap
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "page/views.py", "line": 4, "code": "request.GET.get('q', '')", "kind": "http_query" } ], "sinks": [ { "file": "page/views.py", "line": 5, "code": "HttpResponse('<h1>Results for ' + nickname + '</h1>')", "kind": "httpresponse_concat", "neutralized": false, ...
dj_httpresponse_concat
vuln
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [], "sinks": [ { "file": "src/views/SearchView.vue", "line": 3, "code": "{{ tagline }}", "kind": "vue_interpolation", "neutralized": true, "reason": "Vue mustache interpolation HTML-escapes its value" } ], "vulnerable": false, "findings": [], "safe_patterns": [ { "file": "s...
vue_safe_interp
safe
JavaScript
Vue 3
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "feedback/views.py", "line": 5, "code": "request.GET.get('keyword', '')", "kind": "http_query" } ], "sinks": [ { "file": "feedback/views.py", "line": 6, "code": "escape(title)", "kind": "httpresponse_concat", "neutralized": true, "reason": "Value is HTML-e...
dj_safe_escape
safe
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "post/views.py", "line": 5, "code": "request.GET.get('search', '')", "kind": "http_query" } ], "sinks": [ { "file": "post/views.py", "line": 6, "code": "escape(remark)", "kind": "httpresponse_concat", "neutralized": true, "reason": "Value is HTML-escaped f...
dj_safe_escape
safe
Python
Django
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/components/PageView.vue", "line": 10, "code": "location.search", "kind": "dom_location" } ], "sinks": [ { "file": "src/components/PageView.vue", "line": 11, "code": "box.value.innerHTML = signature", "kind": "innerHTML", "neutralized": false, "reason"...
vue_innerhtml_dom
vuln
JavaScript
Vue 3
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "src/main/java/com/app/PageController.java", "line": 13, "code": "@RequestParam String page", "kind": "request_param" } ], "sinks": [ { "file": "src/main/java/com/app/PageController.java", "line": 15, "code": ".body(\"<div>\" + page + \"</div>\")", "kind": "resp...
sb_responseentity
vuln
Java
Spring Boot
[ { "role": "system", "content": "You are an application-security analyst specialised in cross-site scripting (XSS).\nGiven source files (each line prefixed with its line number), trace untrusted input to output sinks and decide whether an XSS vulnerability exists.\n\nRules:\n- Cite exact line numbers from th...
{ "sources": [ { "file": "feedback/views.py", "line": 4, "code": "request.GET.get('name', '')", "kind": "http_query" } ], "sinks": [ { "file": "feedback/templates/feedback.html", "line": 2, "code": "<a href=\"{{ target }}\">", "kind": "href_attribute", "neutralized": false, "reaso...
dj_href_url_trap
vuln
Python
Django
End of preview. Expand in Data Studio

XSS Detection Bench

Benchmark data for evaluating models that detect cross-site scripting (XSS) in source code (Vue 3, Django, Spring Boot) and report it as a grounded JSON report. It was used to evaluate hareramray325/qwen2.5-coder-1.5b-xss.

⚠️ For education and authorized security testing only. Gold reports include proof-of-concept payloads.

Splits

Split Examples Vulnerable / safe What it measures
test 593 378 / 215 Held-out synthetic examples from the same 20 code templates used in training. Measures in-distribution accuracy.
ood 36 18 / 18 Hand-written examples using sinks, sources and traps the templates never produce. Measures generalization.

The ood split covers patterns like document.write, insertAdjacentHTML, setTimeout with a string, iframe src, unquoted Django attributes, HTML escaping inside onclick, Jinja2 without autoescape, Thymeleaf [( )], FreeMarker ?no_esc, and JSTL escapeXml="false". Its safe half has lookalikes such as json_script, escapejs, bleach/Jsoup sanitising before raw output, scheme-validated URLs, and text/plain responses.

Fields

Field Description
messages Chat prompt: a system prompt plus a user turn holding the code with numbered lines
target Gold JSON report (string). vulnerable is the label; sinks/findings give gold lines, XSS type and output context
template Generator template id (for ood, the example id)
label vuln or safe
language, framework Stack, e.g. Python / Django

Results

Model Split Detection acc. Recall False-positive rate ↓
Qwen2.5-Coder-1.5B-Instruct (base) test 43.0% 97.5% 87.5%
Scan-only LoRA test 100% 100% 0%
qwen2.5-coder-1.5b-xss (chat/mix LoRA) test 86.0% 87.0% 15.8%
Qwen2.5-Coder-1.5B-Instruct (base) ood 41.7% 100% 90.0%
Scan-only LoRA ood 55.6% 64.7% 50.0%
qwen2.5-coder-1.5b-xss (chat/mix LoRA) ood 58.3% 70.6% 50.0%

Scores on the test split are inflated for fine-tuned models because it shares templates with the training data. Compare models on ood.

Scoring

The evaluation script is xssft/eval.py in github.com/hareramray/qwen-cyber. It parses the model's JSON answer and computes these metrics:

  • valid JSON
  • grounding: every cited (file, line, code) exists in the input
  • detection accuracy, recall and false-positive rate
  • sink-line, XSS-type and context accuracy on true positives

License

MIT.

Downloads last month
51

Models trained or fine-tuned on hareramray325/xss-detection-bench