Skip to content

Include error-only groups in JSON reports - #6149

Closed
derekxmartin wants to merge 2 commits into
sqlmapproject:masterfrom
derekxmartin:fix/report-json-error-only-targets
Closed

derekxmartin wants to merge 2 commits into
sqlmapproject:masterfrom
derekxmartin:fix/report-json-error-only-targets

Conversation

@derekxmartin

Copy link
Copy Markdown

writeReportJson collects target IDs from data, but errors can be stored under an active target ID with no data rows. That leaves the target out of the report. For example, if target 1 has results and target 2 has only an error, the report includes target 1 and drops target 2.

This change collects IDs from both data and errors, so both groups are included. Ordering, deduplication, report assembly, and the empty-report fallback are unchanged. The docstring clarifies the existing format. One group produces a flat report; multiple groups use targets. Recovering an omitted group can therefore change a report from flat to targets.

Error-only groups still have no URL identity, and global errors under ID 0 are not reassigned to another target.

The patch makes one functional query change in api.py and adds 10 tests in test_report.py. On native Windows, all 17 existing report tests passed. Before the fix, four new tests failed and six passed. Afterward, all 27 passed. Testing used synthetic in-memory SQLite data and temporary JSON files, with network and subprocess calls blocked. No scans or full-project CI were run.

@derekxmartin
derekxmartin marked this pull request as ready for review October 20, 2026 01:41
stamparm added a commit that referenced this pull request Oct 20, 2026
@stamparm

Copy link
Copy Markdown
Member

Thank you for the report. We made our own version. Each target in the report now carries its URL, so failed targets show up with their errors instead of as anonymous error-only groups.

@stamparm stamparm closed this Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants