-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Smuggling a URL in the MS-DOS stub is not detected #33
Comments
What is the attack vector? Could you provide a repro-(script)? |
@lennybacon To verify, take any signed binary and use a hex editor to change the error message "This program cannot be run in DOS mode" to something else and observe the signature is still valid. The reason is the same as https://github.com/vcsjones/AuthenticodeLint/blob/main/AuthenticodeLint/Rules/10009-NoUnknownUnsignedAttibuteRule.cs ; binary can be watermarked without disturbing signature. Program would do
|
@joshudson Thanks for the explanation! The spec says the digest for the signature is created as follows.
Which looks like it is by design. On the other hand the specification continues with:
Where the "Figure 1" is: And this DOES NOT show the "MS-DOC 2.0 Section" with a gray background. The ImageGetDigestStream could be fed with a DigestFunction which will then have access to the stream to be hashed. Would be an option to validate which parts of the file are actually used for the digest. |
Authenticode doesn't even notice something's wrong, nor does authenticode lint. Setting EnableCertPaddingCheck does nothing, as expected.
Incidentally, I find it hilarious from this thread https://developercommunity.visualstudio.com/t/add-linker-option-to-strip-rich-stamp-from-exe-hea/740443 that MS doesn't seem to know this would work.
The text was updated successfully, but these errors were encountered: