Summary
SpiderFoot does not HTML-escape correlation titles derived from external scan data, such as server banners and metadata. An attacker who can influence those sources may inject markup that executes script in an operator's browser when the correlations view is opened, potentially exposing API keys and other session-accessible data.
Affected context
The vulnerability occurs in SpiderFoot correlation results when titles are constructed from externally supplied scan data and rendered in the operator-facing web interface without context-appropriate output encoding. Risk depends on whether an attacker can influence a scanned source, cause malicious metadata to enter scan results, and have an operator open the affected correlations view.
Exploit preconditions
- Attack surface: SpiderFoot's web-based correlations results interface
- Required access: Ability to influence external scan data, server banners, metadata, or another source consumed by a scan
- Trigger point: An operator opens the correlations view containing the affected title
- Why exploitation is possible: External values are rendered as HTML without sufficient output encoding, allowing browser-interpreted content to execute in the operator's session context
Why this happens
The underlying bug is a failure to treat externally sourced correlation titles as untrusted output.
When data from banners or metadata is inserted into an HTML response without context-aware escaping, markup can be interpreted by the browser instead of displayed as text.
This maps to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Potential impact
- Malicious script execution in an operator's browser
- Theft of API keys, session data, or other browser-accessible secrets
- Unauthorized actions performed through the operator's authenticated session
- Modification or concealment of information displayed in the SpiderFoot interface
- Exposure of scan results and other data available to the affected user
General mitigation guidance
Mitigation generally focuses on treating all scan-derived values as untrusted and applying context-appropriate output encoding before rendering them.
Common defensive patterns include:
- HTML-escaping correlation titles and other external values by default
- Using framework templating APIs with automatic escaping enabled
- Avoiding raw-HTML rendering for data fields that should be plain text
- Applying allowlisted sanitization only where limited rich text is an explicit requirement
- Restricting API-key scope and operator privileges to reduce the impact of browser-session compromise
- Using browser security controls such as an appropriately restrictive Content Security Policy
How teams detect issues like this
Organizations can look for this issue through:
- Static analysis rules that identify unescaped values inserted into HTML templates
- Code review checks for raw HTML rendering and disabled template escaping
- Tests that place browser-significant characters in banner, metadata, and correlation-title fields
- Dynamic application testing that verifies external scan data is displayed as text rather than interpreted markup
- Policy enforcement requiring context-aware output encoding at web rendering boundaries
Automated security review tools may help identify suspicious data flows from scan sources into HTML responses.

