fix: harden update checker (sanitize tag, add HTTP timeout)#29
Open
staryxchen wants to merge 3 commits intofslongjin:masterfrom
Open
fix: harden update checker (sanitize tag, add HTTP timeout)#29staryxchen wants to merge 3 commits intofslongjin:masterfrom
staryxchen wants to merge 3 commits intofslongjin:masterfrom
Conversation
- Sanitize tag input to allow only alphanumeric, '.', '-', '_' characters. - Use sanitized tag in the installation command output. Signed-off-by: staryxchen <staryxchen@tencent.com>
- Set connect_timeout and timeout for improved request reliability Signed-off-by: staryxchen <staryxchen@tencent.com>
- Update version in Cargo.toml to 0.7.2 - Update installation commands in README files to v0.7.2 Signed-off-by: staryxchen <staryxchen@tencent.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
update_info.tagto only allow alphanumeric,.,-,_characters before embedding it in thecargo installcommand shown to users, preventing potential command injection via MITM-poisoned responses.reqwest::get()with a client configured with 5s connect timeout and 10s total timeout, preventing the tool from blocking indefinitely when the update server is unreachable.Context
The update checker had two issues:
tagfield from the server response was used directly in a displayedcargo installcommand with no validation.