diff --git a/src/seclab_taskflows/personalities/web_application_security_expert.yaml b/src/seclab_taskflows/personalities/web_application_security_expert.yaml index 58033e0..cce8a82 100644 --- a/src/seclab_taskflows/personalities/web_application_security_expert.yaml +++ b/src/seclab_taskflows/personalities/web_application_security_expert.yaml @@ -19,5 +19,5 @@ task: | toolboxes: - seclab_taskflow_agent.toolboxes.memcache - seclab_taskflows.toolboxes.gh_file_viewer - - seclab_taskflow_agent.toolboxes.codeql + - seclab_taskflow_agent.toolboxes.codeql_ql_mcp - seclab_taskflows.toolboxes.ghsa diff --git a/src/seclab_taskflows/taskflows/alert_triage_examples/triage_common/reachability_analysis.yaml b/src/seclab_taskflows/taskflows/alert_triage_examples/triage_common/reachability_analysis.yaml index 704f921..51271fa 100644 --- a/src/seclab_taskflows/taskflows/alert_triage_examples/triage_common/reachability_analysis.yaml +++ b/src/seclab_taskflows/taskflows/alert_triage_examples/triage_common/reachability_analysis.yaml @@ -30,6 +30,14 @@ taskflow: Create a call graph to understand how the code flows from the entry point to the vulnerable code. Let's think step by step and go through the call graph. Always try to find out whether the code is in use and reachable from the outside (e.g. via HTTP request). + Use the CodeQL Development MCP server to compute the call graph authoritatively rather than guessing from + text search. Use `list_codeql_databases` to find the database for {{ result.repo }}, then use `codeql_query_run` + with the bundled tools query `CallGraphTo.ql` to find callers of the function containing the alert location, + and `CallGraphFrom.ql` to find callees. Pass the alert file and line as the location. Iterate outward from the + alert location until you either reach a remote/HTTP entry point or exhaust the callers. If you need to inspect + the structure of a single function, use `PrintAST.ql` or `PrintCFG.ql`. Fall back to `gh_file_viewer` only when + the database is unavailable. + You should trace the calls where the data is passed through and in each call, check whether relevant sanitization is applied to the data. @@ -59,6 +67,7 @@ taskflow: You must then update the alert results with your notes. You should finish the task without changing the alert validity. toolboxes: + - seclab_taskflow_agent.toolboxes.codeql_ql_mcp - seclab_taskflows.toolboxes.gh_file_viewer - seclab_taskflows.toolboxes.report_alert_state diff --git a/src/seclab_taskflows/taskflows/alert_triage_examples/triage_taskflows/triage_js_ts_client_side_xss.yaml b/src/seclab_taskflows/taskflows/alert_triage_examples/triage_taskflows/triage_js_ts_client_side_xss.yaml index 7816829..0f11efe 100644 --- a/src/seclab_taskflows/taskflows/alert_triage_examples/triage_taskflows/triage_js_ts_client_side_xss.yaml +++ b/src/seclab_taskflows/taskflows/alert_triage_examples/triage_taskflows/triage_js_ts_client_side_xss.yaml @@ -6,8 +6,12 @@ seclab-taskflow-agent: version: "1.0" model_config: seclab_taskflows.configs.model_config +# Required: pass the target repository on the command line, e.g. +# --global repo=has-ghas/juice-shop +# An empty default fetches alerts for no repository. globals: rule: js/xss + repo: taskflow: - task: must_complete: true @@ -18,7 +22,7 @@ taskflow: name: create repo list description: create repo list to fetch alerts from. run: | - echo '[ {"repo": ""}]' + echo '[ {"repo": "{{ globals.repo }}"}]' - task: headless: true uses: seclab_taskflows.taskflows.alert_triage_examples.triage_common.fetch_code_scanning_alerts @@ -50,6 +54,12 @@ taskflow: In this task, restrict your analysis to the function that contains the alert location only. Do not trace the calls of the function. Just perform a local analysis. + Use the CodeQL Development MCP server to get an authoritative view of that function: call `list_codeql_databases` + to find the database for {{ result.repo }}, then run the bundled `PrintAST.ql` tools query at the alert location + to get the exact AST of the enclosing function. This is more reliable than reading the file textually for + identifying real branches, sanitizer calls, and the syntactic context (HTML attribute, JS string, etc.) of the + sink. Fall back to `gh_file_viewer` only if the database is unavailable. + Exploitable means that a remote attacker would be able to inject a malicious script into the web application that would be executed in the context of a user visiting the page. This could include a `javascript:` URL, a `