Re:Third High Severity CVE in Log4j Is Published
by derefr on Saturday December 18, 2021 @08:11PM
(#29610416)
On Windows, the Microsoft compilers and linkers have inserted such toolchain/library version metadata into PE executables for decades now (the "RICH" header — https://bytepointer.com/articles/the_microsoft_rich_header.h...).
At the time that Microsoft started doing it, paranoiacs thought it was some kind of anti-piracy software fingerprinting mechanism, embedding the compiling computer's MAC address or something. But really, it serves exactly the same purpose that Golang's effort does here: to let you map compiled-artifact back to inputs.
Re:Third High Severity CVE in Log4j Is Published
by xxgreg on Saturday December 18, 2021 @05:52PM
(#29609423)
There's also ongoing work to build a dependency vulnerability database. This is proposed to be surfaced via a built in `go audit` command.
https://go.googlesource.com/proposal/+/master/design/draft-v...
Re:Third High Severity CVE in Log4j Is Published
by pabs3 on Saturday December 18, 2021 @10:10PM
(#29610984)
So if you make a commit to the README.md fixing a typo, now your build of the source code has a different checksum? I wonder why they don't instead hash all the source files and then embed that hash.
Re:Third High Severity CVE in Log4j Is Published
by yawaramin on Sunday December 19, 2021 @06:00PM
(#29619446)
> So if you make a commit to the README.md fixing a typo, now your build of the source code has a different checksum?
Yes...? What's the problem?
> why they don't instead hash all the source files and then embed that hash.
This is almost exactly what the git sha is. If you're arguing that README.md files shouldn't be included in the checksum, that's subjective. Many people would argue otherwise. And it doesn't hurt to be more accurate than less.
Re:Third High Severity CVE in Log4j Is Published
by pabs3 on Friday December 24, 2021 @04:38AM
(#29672064)
The git commit hash is less accurate, since it includes extra files like README.md that aren't converted to any part of the executable.
Re:Third High Severity CVE in Log4j Is Published
by Too on Sunday December 19, 2021 @01:44AM
(#29611976)
That doesn’t provide a link back to the source, unless you store that hash elsewhere. Giving you the problem of maintaining a database also.
Re:Third High Severity CVE in Log4j Is Published
by pabs3 on Friday December 24, 2021 @04:39AM
(#29672079)
You store the source packages alongside the binary packages, and then index hashes of all the source/binary package contents. Then you know which source files were used from which source/binary packages to produce a particular executable.
> The go command now embeds version control information in binaries including the currently checked-out revision and a flag indicating whether edited or untracked files are present.... Additionally, the go command embeds information about the build including build and tool tags (set with -tags), compiler, assembler, and linker flags (like -gcflags), whether cgo was enabled, and if it was, the values of the cgo environment variables (like CGO_CFLAGS).