Skip to content

fix(security): 2 improvements across 2 files#992

Open
tomaioo wants to merge 2 commits intowebrecorder:mainfrom
tomaioo:fix/security/tls-certificate-verification-disabled-fo
Open

fix(security): 2 improvements across 2 files#992
tomaioo wants to merge 2 commits intowebrecorder:mainfrom
tomaioo:fix/security/tls-certificate-verification-disabled-fo

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 11, 2026

Summary

fix(security): 2 improvements across 2 files

Problem

Severity: High | File: pywb/warcserver/http.py:L12

The custom HTTP adapter defaults to cert_reqs='CERT_NONE', and warnings are globally suppressed via urllib3.disable_warnings(). This disables server certificate validation for live/remote fetches, enabling man-in-the-middle attacks and silent interception/modification of fetched content.

Solution

Enable certificate verification by default (CERT_REQUIRED), configure trusted CA bundle/dir, and remove global warning suppression. If insecure mode is needed, gate it behind an explicit opt-in configuration flag with clear warnings.

Changes

  • pywb/warcserver/http.py (modified)
  • pywb/rewrite/jsonp_rewriter.py (modified)

tomaioo added 2 commits April 11, 2026 11:17
- Security: TLS certificate verification disabled for outbound HTTP requests
- Security: Unsanitized JSONP callback rewrite allows script injection in rewritten response

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
- Security: TLS certificate verification disabled for outbound HTTP requests
- Security: Unsanitized JSONP callback rewrite allows script injection in rewritten response

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
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.

1 participant