fix security vulnerability RUSTSEC-2024-0421 #138
Merged
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.
RUSTSEC-2024-0421 reports a vulnerability in the crate idna which is a dependency of a dependency of the mongodb rust driver. Specifically it interprets non-ASCII characters in domain names.
This change updates
Cargo.lock
to update two direct dependencies of the mongodb driver, hickory-proto and hickory-resolver from v0.24.1 to v0.24.2. That in turn updates the dependency on idna from v0.4 to v1.0.0 which is not affected by RUSTSEC-2024-0421. There are also a couple of small documentation updates here that are not relevant to the security fix, but that I want to get in. Those changes switch from a deprecated form of thenix flake
command to the newer syntax.MongoDB has an upstream fix for the driver which makes the same change: bumping the hickory dependencies to v0.24.2. That fix was made this morning, and is not available in the latest driver release which as of this writing is v3.1.0.
The vulnerability allows an attacker to craft a domain name that older versions of idna interpret as identical to a legitimate domain name, but that is in fact a different name. I think this does not impact the MongoDB connector since it uses the affected library exclusively to connect to MongoDB databases, and database URLs are supplied by trusted administrators. But best to get the fix anyway.