sanitize version_string we got from the wire (#8582)

`version_string` is meant to be displayed by UI, and comes from the
wire.

therefore, as a general precaution, ensure a string that is
regarded as a typical version string. all versions in scope are
currently v123.456.789-shortsuffix, where suffix is a-z and mostly
unused in production. that is the base. we can adapt if there is really
a need, but not for theoretical version strings. as we do not stop
processing, things are not bad even if we missed a valid usecase herr.

moreover, if `version_string` is empty, we skip the candidate - as we
cannot display something useful to the user. that little bit of care is
expected from relays :)
This commit is contained in:
biørn
2026-08-14 14:01:15 +02:00
committed by GitHub
parent e322fdf157
commit 07e18c64af
2 changed files with 53 additions and 4 deletions

View File

@@ -9,7 +9,9 @@ pub struct JsonrpcAppSource {
/// Always increasing version number.
pub version_integer: u32,
/// Any version string.
/// Version string that should be shown to the user.
/// UI must not linkify the string
/// as it may be interpreted like a phone number or an IP address.
pub version_string: String,
/// Where to download that version.