Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the Authenticode certificate for extended validation for any downloaded coder binaries. #45

Closed
spikecurtis opened this issue Mar 6, 2025 · 0 comments · Fixed by #36

Comments

@spikecurtis
Copy link
Collaborator

We currently check the Subject name on the certificate matches "Coder Technologies Inc.", but we went thru a lot to get an extended validation certificate, so we should have Coder Desktop also check that the Authenticode certificate is an extended validation cert. This will make it much harder for an malicious actor to successfully sign binaries and have them executed by Coder Desktop.

$sig =  Get-AuthenticodeSignature -FilePath "C:\Program Files\Coder\bin\coder.exe"
foreach ($ext in $sig.SignerCertificate.Extensions) {$ext.Oid}

gives:

Value             FriendlyName
-----             ------------
2.5.29.35         Authority Key Identifier
2.5.29.14         Subject Key Identifier
2.5.29.32         Certificate Policies
2.5.29.15         Key Usage
2.5.29.37         Enhanced Key Usage
2.5.29.31         CRL Distribution Points
1.3.6.1.5.5.7.1.1 Authority Information Access
2.5.29.19         Basic Constraints

We are interested in the Certificate Policies extension, OID 2.5.29.32. If we decode that extension, we get

            SEQUENCE {
               SEQUENCE {
                  OBJECTIDENTIFIER 2.23.140.1.3
                  SEQUENCE {
                     SEQUENCE {
                        OBJECTIDENTIFIER 1.3.6.1.5.5.7.2.1
                        IA5String 'http://www.digicert.com/CPS'
                     }
                  }
               }
            }

OID 2.23.140.1.3 is for Extended Validation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant