Commit fd42b2f
committed
fix(android): clamp imported socksPort to valid range 1-65535
parseProfileFromJson read socks_port from imported JSON without any
bounds check, so a malformed or hostile profile could specify
socks_port: 99999 (or 0, or negative) and it would flow straight
into the exported config and the SOCKS5 client. Add coerceIn(1, 65535)
on the import path; default remains 1080 when the field is absent.
Found by ProfilesViewModelParseTest.clamps socksPort to 1_65535 range
during plan 001 baseline creation.1 parent b926ea6 commit fd42b2f
1 file changed
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
0 commit comments