We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ef9e704 + abb6ead commit b532fa8Copy full SHA for b532fa8
src/uploaders.rs
@@ -271,6 +271,17 @@ fn verify_tarball(
271
if !entry.path()?.starts_with(&prefix) {
272
return Err(human("invalid tarball uploaded"));
273
}
274
+
275
+ // Historical versions of the `tar` crate which Cargo uses internally
276
+ // don't properly prevent hard links from overwriting arbitrary files on
277
+ // the filesystem.
278
+ //
279
+ // As a bit of a hammer we reject any tarball with a hard link. Cargo
280
+ // doesn't currently ever generate a tarball with a hard link so this
281
+ // should work for now.
282
+ if entry.header().entry_type().is_hard_link() {
283
+ return Err(human("invalid tarball uploaded"));
284
+ }
285
286
Ok(())
287
0 commit comments