SOCKS 4/4A HTML injection in malformed socks server ACK response

UNCONFIRMED
Unassigned

Status

()

P3
normal
UNCONFIRMED
a year ago
a year ago

People

(Reporter: n.avanzi, Unassigned, NeedInfo)

Tracking

54 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [necko-backlog])

Attachments

(1 attachment)

(Reporter)

Description

a year ago
Created attachment 8897882 [details]
proxy.py

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36

Steps to reproduce:

in attachment a simple socks 4/4a proxy written in python for linux, You must configure Firefox to use socks server on port 1080, So try visiting a website like http://www.ansa.it (not work with https site)


Actual results:


With Firefox configured to use SOCKS server, if evil socks server send a malformed ACK like this:
       +----+----+----+----+----+----+----+----+-----------------------
       | VN | CD | DSTPORT |      DSTIP        |<head><title>hacked...
       +----+----+----+----+----+----+----+----+-----------------------
bytes:    1    1      2              4              n byte of code to inject

Firefox Insert the injected code at the beginning of all the pages you visit.
You can then change the content of the pages you visit with malicious code
Group: firefox-core-security → network-core-security
Component: Untriaged → Networking
Product: Firefox → Core
Proxies can explicitly modify unencrypted traffic so this isn't a new capability beyond stuff that's fairly intentional (however unwanted it may be). I'll defer to the Network folk about whether injecting content through an ACK is legit or not.
Group: network-core-security
Flags: needinfo?(mcmanus)

Updated

a year ago
Whiteboard: [necko-backlog]
You need to log in before you can comment on or make changes to this bug.