Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1609 from JiaT75/added_error_message_to_warning_b…
…sdtar_1561 Added error text to warning when untaring with bsdtar
- Loading branch information
e37efc1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmatuska Note that the author/github account of this PR is implicated in a security incident regarding xz. Seeing how one of the lines was possibly downgraded from safe_fprintf to just fprintf, there might be some exploit angles/scenarios at play here as well. It looks a bit weird at first glance.
e37efc1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://owasp.org/www-community/attacks/Format_string_attack
https://cs155.stanford.edu/papers/formatstring-1.2.pdf
e37efc1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ihexon This is not a format string attack, since the format strings themselves are still plain/valid (
": %s: "
and"%s"
). The difference betweensafe_fprintf
andfprintf
is how they handle non-printable characters in their output, and not in their handling of the format strings themselves (fmt
goes straight into theva_args
calls without modification).Note that
safe_fprintf
is still used witharchive_entry_pathname(entry)
; the concern would be if something could be done with non-printable characters fromarchive_error_string(a)
orstrerror(errno)
hittingstderr
(which is newly added).e37efc1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been discussed over in #1609 and fixed in #2101.