Microsoft allows you to sign an executable, and has a list of certificates to validate those signatures.
However it is possible to change the data on a file, while still passing the signature check, allowing you to add or change data in certain parts of it.
Does this pose any security risk?
Quoting from an old blog post (which is still relevant):
However it is possible to change the data on a file, while still passing the signature check, allowing you to add or change data in certain parts of it.
Does this pose any security risk?
Quoting from an old blog post (which is still relevant):
However three areas of a PE executable are excluded from the hash computation:
the Checksum in the optional Windows specific header: 4 bytes.
the Certificate Table entry in the optional Windows specific header: 8 bytes.
the Digital Certificate section at the end of the file: variable length.
You should be able to change those area without breaking the signature. I have discovered by accident that it is possible to append an arbitrary amount of data at the end of the Digital Certificate. The data are ignored by both the signature parsing and hash computation algorithms. It works on all version of Windows I tested (2000, XP, Vista), as long as the length of the Certificate Table is correctly increased. The length is stored in two different location: the PE header and the beginning of the certificate table.