cloudflare / boringtun

Userspace WireGuard® Implementation in Rust
BSD 3-Clause "New" or "Revised" License
5.92k stars 397 forks source link

fix: validate api input #356

Open Banyc opened 10 months ago

Banyc commented 10 months ago

Previously, there is a potential footgun situation:

echo "set=1\nlisten_port=12345" | sudo socat UNIX-CONNECT:/var/run/wireguard/utun0.sock -

This command is considered valid but the listen port is set to 1234 instead.

After this change, the input above will be rejected with EPROTO instead.