internetarchive / internetarchive/warcprox
Localhost access blocking can be circumvented using IPv4-mapped IPv6 addresses
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 467
- Forks
- 66
- PR merge metrics
- No merged PRs in 30d
Description
#213 blocks access to localhost for security reasons. This check can be circumvented using IPv4-mapped IPv6 addresses.
Launch warcprox
$> warcprox -z -d .
Request the homepage of localhost using the following URL variants:
export http_proxy=http://localhost:8000
wget http://localhost/ \
http://[0:0:0:0:0:ffff:127.0.0.1]/ http://[::ffff:127.0.0.1]/ http://[::ffff:7f00:1]/ \
http://[::1]/ http://127.0.0.1/
Warcprox log snippets:
2026-07-14 16:28:22,034 1917529 ERROR MitmProxyHandler(tid=1917552,started=2026-07-14T14:28:22.028264+00:00,client=127.0.0.1:52982) warcprox.warcprox.WarcProxyHandler.do_COMMAND(mitmproxy.py:459) error from remote server(?) 'GET http://localhost/ HTTP/1.1': BadRequest('request rejected by warcprox: localhost access is not permitted')
2026-07-14 16:28:22,039 1917529 ERROR MitmProxyHandler(tid=1917552,started=2026-07-14T14:28:22.038715+00:00,client=127.0.0.1:52992) warcprox.warcprox.WarcProxyHandler.do_COMMAND(mitmproxy.py:459) error from remote server(?) 'GET http://[::1]/ HTTP/1.1': BadRequest('request rejected by warcprox: localhost access is not permitted')
2026-07-14 16:28:22,040 1917529 ERROR MitmProxyHandler(tid=1917552,started=2026-07-14T14:28:22.039773+00:00,client=127.0.0.1:53006) warcprox.warcprox.WarcProxyHandler.do_COMMAND(mitmproxy.py:459) error from remote server(?) 'GET http://127.0.0.1/ HTTP/1.1': BadRequest('request rejected by warcprox: localhost access is not permitted')
Requests per IPv4-mapped host names are captured:
[vysun:warcprox] zgrep -B5 -aF 'WARC-IP-Address:' WARCPROX-20260714144022092-00000-ry4pkedx.warc.gz
WARC/1.0
WARC-Type: response
WARC-Record-ID: <urn:uuid:c100d959-29c4-4658-a62b-8875d975584a>
WARC-Date: 2026-07-14T14:28:22Z
WARC-Target-URI: http://[0:0:0:0:0:ffff:127.0.0.1]/
WARC-IP-Address: ::ffff:127.0.0.1
--
WARC/1.0
WARC-Type: response
WARC-Record-ID: <urn:uuid:935d61b9-4673-461a-9448-0927a48c888d>
WARC-Date: 2026-07-14T14:28:22Z
WARC-Target-URI: http://[::ffff:127.0.0.1]/
WARC-IP-Address: ::ffff:127.0.0.1
--
WARC/1.0
WARC-Type: revisit
WARC-Record-ID: <urn:uuid:37866100-3447-4c4f-a096-5e1e696152a2>
WARC-Date: 2026-07-14T14:40:22Z
WARC-Target-URI: http://[::ffff:7f00:1]/
WARC-IP-Address: ::ffff:127.0.0.1
Note: this issues was discovered when studying how WARC writers record IPv6-mapped IPv4 addresses.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the localhost access check introduced in #213, then reproduce the issue with the listed warcprox command and IPv4-mapped IPv6 URL variants. Done means requests using the mapped forms are rejected like localhost, while the existing localhost and ::1 blocking behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 63/100