Repository navigation
update: replace serde_yaml with serde-saphyr - #358
Merged
Merged
Conversation
serde_yaml is deprecated and pulls in unsafe-libyaml, which is archived and reported by cargo deny as RUSTSEC-2024-0449. bssh only uses from_str and to_string, so switch every call site to serde-saphyr 2.1.1, a parser written in safe Rust and the alternative the advisory recommends. Configs that loaded before parse to the same values except when they use YAML merge keys (<<), which serde_yaml ignored and serde-saphyr applies. A few inputs serde_yaml rejected now load: YAML 1.1 booleans such as yes, quoted numbers, and underscored integers. gen-config output only differs in quoting bind_address.
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.
Summary
Replace the deprecated
serde_yamlwithserde-saphyr2.1.1, a YAML parser written in safe Rust. This removesunsafe-libyaml(archived, RUSTSEC-2024-0449) from the dependency tree;cargo deny check advisoriesnow reports only the rsa advisory, which waits on russh (Eugeny/russh#821). bssh only callsfrom_strandto_string, so the change is a call-site rename plus the manifest and lockfile.Behavior
Both libraries were run on the same edge-case inputs. Empty and comment-only files, duplicate keys (error), tabs, anchors, unknown fields, multiple documents, and
${VAR}text behave the same.<<: *anchor) are now applied; serde_yaml silently ignored them.yes/no), quoted numbers (port: "22"), and underscored integers (1_000).bssh-server gen-configoutput differs only in quotingbind_address: "0.0.0.0".Validation
cargo fmt --checkandcargo clippy --all-targets --all-features -- -D warningspass. The full test suite passes except the fourtests/integration_test.rstests that fail locally on cleanmainas well. The new crates are MIT or Apache-2.0, add no duplicate crates, and need Rust 1.89 at most (MSRV 1.97).