Shelikhoo
807b820e7b
dynamic address length calculation in shadowsocks udp encoding
2026-01-14 14:04:59 +00:00
fengweiyuan and Xiaokang Wang (Shelikhoo)
876d7f7cb2
There is a buffer overflow bug in Shadowsocks UDP packet encoding. In the EncodeUDPPacket function of proxy/shadowsocks/protocol.go, a fixed-size buffer of 2048 bytes is created using buf.New().
...
However, the actual size of a UDP packet includes:
IV: 16 bytes (e.g., for aes-128-gcm)
Destination address: 7~258 bytes (depending on IPv4/IPv6/domain)
Payload: variable, up to 2048 bytes
AEAD authentication tag: 16 bytes
When the incoming payload is large (close to 2048 bytes), the total size exceeds the buffer capacity. When b.Extend() is called in AEADCipher.EncodePacket() to allocate space for the authentication tag, it triggers panic: extending out of bound, causing the process to crash.
Fix
Before creating the buffer, calculate the required buffer size based on IV length, maximum address length (258 bytes), payload length, and AEAD overhead (16 bytes). If the required size exceeds the default buffer size (2048 bytes), use buf.NewWithSize() to allocate a sufficiently large buffer.
2025-12-29 18:57:46 +00:00
Shelikhoo
ac68bb34da
update generated protocol buffer files
2025-07-03 17:52:42 +01:00
Shelikhoo
3ee9045697
chore: regenerate protos
2025-02-02 13:57:34 +00:00
Kasefuchs and GitHub
6a242d1e2e
feat: add jsonpb marshallers ( #3165 )
2024-10-12 19:26:59 +01:00
Shelikhoo
1fcaca7145
enable restricted mode load for some settings
2023-11-26 10:55:27 +00:00
Shelikhoo
cb84b28de4
Update generated protobuf files to v1.31.0
2023-10-24 19:50:30 +01:00
秋のかえで and GitHub
d58649764e
fix: parse for the CipherType of Shadowsocks in simplified config ( #2510 )
2023-07-25 16:27:53 +08:00
Huang-Huang Bao and Xiaokang Wang (Shelikhoo)
ddc6312c5d
Fix: guard against nil pointer dereference of (*NetworkList)
2022-09-07 10:50:17 +01:00
Shelikhoo
137cd7093c
chore: regenerate protobuf file
2022-09-06 20:36:27 +01:00
秋のかえで
8b7d283bf8
Feat: rename network to networks for JsonV5
2022-08-19 22:28:20 +08:00
秋のかえで and GitHub
adb7871f82
Feat: refine cipher and network config ( #1436 )
2022-08-19 20:41:18 +08:00
lrh2000 and Shelikhoo
396ee770b7
proxy: Unify timeouts of different protocols for reading the first payload
2022-06-25 19:34:32 +01:00
7bcb3c901b
Fix client dialer log ( #1568 )
...
* Fix client dialer log
Log such as:
tunneling request to tcp:www.google.com:80 via tcp:x.x.x.x:443
the second "tcp" is misleading when using mKcp or quic transport
Remove the second "tcp" and add the correct logging for transport dialer:
- transport/internet/tcp: dialing TCP to tcp:x.x.x.x:443
- transport/internet/quic: dialing quic to udp:x.x.x.x:443
* Update transport/internet/quic/dialer.go
Co-authored-by: 秋のかえで <autmaple@protonmail.com >
Co-authored-by: 秋のかえで <autmaple@protonmail.com >
Co-authored-by: Kslr <kslrwang@gmail.com >
2022-04-06 13:24:43 +08:00
Shelikhoo
ca5695244c
add reduced iv head entropy to simplified config processor(fix)
2022-01-15 20:47:20 +00:00
Shelikhoo
d7eb207c12
add reduced iv head entropy to simplified config processor
2022-01-15 20:47:20 +00:00
Shelikhoo
3fb2852201
add reduced iv head entropy to simplified config: auto generated
2022-01-15 20:47:20 +00:00
Shelikhoo
d8f36941a8
add reduced iv head entropy to simplified config
2022-01-15 20:47:20 +00:00
Shelikhoo
0746740b10
add reduced entropy experiment to shadowsocks
2022-01-15 20:47:20 +00:00
Shelikhoo
eced27b48b
config for reduced initial iv head entropy: auto generated
2022-01-15 20:47:20 +00:00
Shelikhoo
dbacf9a6c5
config for reduced initial iv head entropy
2022-01-15 20:47:20 +00:00
Shelikhoo
a9bf783ad7
fix lint
2022-01-03 15:55:18 +00:00
Shelikhoo
0b8eeb0f98
fix error introduced by rebase: auto generated
2022-01-03 15:55:18 +00:00
Shelikhoo
91ca22f44e
shadowsockets fullcone inbound support: fix apply simplified config
2022-01-03 15:55:18 +00:00
Shelikhoo
f48f61bb25
shadowsockets fullcone inbound support: auto generated
2022-01-03 15:55:18 +00:00
Shelikhoo
e28ef6a47d
shadowsockets fullcone inbound support
2022-01-03 15:55:18 +00:00
Shelikhoo
d068b60791
shadowsockets fullcone outbound support
2022-01-03 15:55:18 +00:00
Shelikhoo
ac65036808
refactor UDP dispatcher to support fullcone dispatcher
2022-01-03 15:55:18 +00:00
Shelikhoo
3ef7feaeaf
update version: auto replacement to v5 path
2022-01-02 15:16:23 +00:00
Bo He and GitHub
b057a37fd6
fix some typo ( #1482 )
2021-12-27 12:33:08 +08:00
Loyalsoldier and GitHub
dce8764fd7
Lint: fix lint ( #1427 )
...
* Lint: replace golint with revive
* Lint: fix lint
2021-11-27 17:16:41 +08:00
Loyalsoldier and GitHub
43447aa2e4
Chore: format code to fix lint ( #1426 )
2021-11-27 14:32:07 +08:00
世界 and Shelikhoo
7d78683d6f
Send shadowsocks handshake with payload if available ( #1292 )
2021-09-27 22:14:11 +01:00
秋のかえで and Shelikhoo
35ba772e6e
feat: add Dokodemo simplified config
2021-09-07 13:51:05 +01:00
秋のかえで and Shelikhoo
383bd4ce62
feat: add network to Shadowsocks simplified config
2021-09-07 13:50:47 +01:00
秋のかえで and Shelikhoo
679d713b89
feat: add Shadowsocks simplified config
2021-09-07 13:50:06 +01:00
Shelikhoo
e0700ccc4b
regenerate protobuf file
2021-09-04 11:26:13 +01:00
Shelikhoo
1531cb0ca4
update protobuf version
2021-09-04 11:13:51 +01:00
Jebbs and Shelikhoo
b05a469488
v5: Remove v2ctl & wv2ray (rebased from 7c1ab06206)
2021-09-04 11:09:55 +01:00
database64128 and GitHub
c78ee5aac7
🏡 Housekeeping: Update to Go 1.17 ( #1215 )
...
* ⬆ Update to Go 1.17
* 🏗 Update workflows and add windows-arm64
* 💾 Update generated files
* 📛 Update not-so-friendly filenames
2021-08-21 13:20:40 +08:00
Shelikhoo
1409be04c2
regenerate protobuf files
2021-07-01 18:58:48 +01:00
Loyalsoldier and GitHub
d7a202a705
Lint: update linter config & fix code style ( #1089 )
...
* Lint: update linter config
* Fix: code style
2021-06-22 22:36:23 +08:00
Shelikhoo
79174ab2a0
unified drain support for vmess and shadowsockets
2021-06-22 12:26:17 +01:00
Loyalsoldier and GitHub
6f8979d017
Style: format code by gofumpt ( #1022 )
2021-05-20 05:28:52 +08:00
Loyalsoldier and GitHub
b50d692128
Chore: update protobuf & dependencies ( #844 )
2021-04-02 21:48:27 +08:00
Loyalsoldier and GitHub
c80a6df749
Chore: format code ( #842 )
2021-04-02 20:49:45 +08:00
Shelikhoo
d55d5423fb
use shadowsocket's bloomring for shadowsocket's replay protection
2021-04-01 21:01:39 +01:00
Shelikhoo
7f5bc447d9
iv check should proceed after decryption
2021-04-01 20:59:36 +01:00
Shelikhoo
b5e29ea14e
Rename to shadowsockets iv check
2021-04-01 20:59:35 +01:00
Shelikhoo
e4681e8cd3
added shadowsockets iv check for tcp socket
2021-04-01 20:59:35 +01:00