Improved JSON parsing and error handling for tool modules#1952
Open
louiselalanne wants to merge 4 commits intosmicallef:masterfrom
Open
Improved JSON parsing and error handling for tool modules#1952louiselalanne wants to merge 4 commits intosmicallef:masterfrom
louiselalanne wants to merge 4 commits intosmicallef:masterfrom
Conversation
cbxss
added a commit
to cbxss/spiderfoot
that referenced
this pull request
Feb 7, 2026
…ken modules - Migrate from requirements.txt to pyproject.toml with relaxed dependency bounds - Switch to uv for package management across project and Docker - Update Docker: Alpine 3.20, Python 3.12-bookworm, fix Node/Wappalyzer setup - Fix secure library API for 1.x (was 0.3.x), PyPDF2 -> pypdf API - Fix 14 type()==Y patterns to isinstance() - Cherry-pick upstream bug fixes: WhatsMyName fields (smicallef#1894), nmap parsing (smicallef#1879), DNS for Family IP (smicallef#1872), nuclei/wafw00f/whatweb JSON parsing (smicallef#1952), db.py UnboundLocalError (smicallef#1787), dev port correlation (smicallef#1827), accounts strip_bad_char support (smicallef#1828) - Add 5 new modules: InternetDB (Shodan free), LeakCheck (paid+free), WhoisFreaks, ip2location.io 238/238 modules load successfully on Python 3.12. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improved JSON parsing and error handling for tool modules
Summary
This PR improves the robustness and reliability of three tool integration modules (
sfp_tool_nuclei,sfp_tool_wafw00f, andsfp_tool_whatweb) by fixing JSON parsing issues and enhancing error handling.Changes
1. sfp_tool_nuclei.py
Problem: The module was failing to parse Nuclei's JSONL (JSON Lines) output format correctly, causing crashes when processing vulnerability scan results.
Improvements:
{)classification.cve-idfield and template ID patternsmatched-atURLs usingurlparsejson.JSONDecodeErrorandKeyErrorWEBSERVER_TECHNOLOGYevents for informational findings2. sfp_tool_wafw00f.py
Problem: Temporary files were not being cleaned up properly in case of errors.
Improvements:
finallyblock to ensure temporary output files are always removed3. sfp_tool_whatweb.py
Problem: The module was crashing with
JSONDecodeErrorbecause WhatWeb outputs JSONL format (one JSON object per line), not a single JSON array.Improvements:
decode('utf-8', errors='ignore')HTTPServerandX-Powered-Byplugin data structuresTesting
All three modules have been tested with their respective tools:
Backwards Compatibility
All changes are backwards compatible and do not affect the module configurations or options.
Related Issues: Fixes JSON parsing errors in tool integration modules
Type of change: