mirror of
https://github.com/alireza0/s-ui.git
synced 2026-11-18 06:03:15 +00:00
GetHeaders returns the client's remark (or name) as the Profile-Title value, and neither field has any character restriction on the way in -- validateClientName checks only emptiness and duplicates, and the remark is not validated at all. addHeaders then sets the header verbatim. Go's net/http refuses to write a response whose header values contain control bytes, so a remark with a CR or LF in it does not inject a header (that is not possible) -- it makes the whole subscription response fail to write. Link, clash and json formats all go through GetHeaders, so one bad remark silently breaks every subscription format for that client until an admin edits the remark; the subscriber cannot fix their own name or remark. Everything around this one header is already sanitized -- the Content-Disposition built from the same value goes through asciiSafeFilename + rfc5987Encode, and admin-defined custom headers are validated with httpguts.ValidHeaderFieldValue. Strip control characters from the title in GetHeaders, at the source, and add a regression test. Related, for a separate look: the name doubles as the subscription ID, so a name containing '/' can never match the single-segment /:subid route -- the same missing character-set constraint on names, but a naming-policy question rather than this bug, so it is not touched here. Prepared by muse ai |
||
|---|---|---|
| .. | ||
| common | ||
| base64.go | ||
| cert.go | ||
| cert_ping_test.go | ||
| genLink.go | ||
| genlink_test.go | ||
| host.go | ||
| linkToJson.go | ||
| linkToJson_ss_test.go | ||
| linkToJson_xhttp_test.go | ||
| outJson.go | ||
| outJson_test.go | ||
| password.go | ||
| password_test.go | ||
| shadowsocks.go | ||
| subInfo.go | ||
| subinfo_test.go | ||
| subToJson.go | ||