Skip to content

Do not take a chain's root CA for a self-signed signer - #597

Merged
doomedraven merged 1 commit into
CAPESandbox:masterfrom
voidm4p:fix-self-signed-chain-root
Sep 25, 2026
Merged

doomedraven merged 1 commit into
CAPESandbox:masterfrom
voidm4p:fix-self-signed-chain-root

Conversation

@voidm4p

@voidm4p voidm4p commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

A root CA signs itself, so every complete certificate chain holds a self-signed certificate, and pe_cert_self_signed flagged it unless its name was in KNOWN_CA_TERMS. Since digital_signers is filled again (and read from target.file after #596), this fires on legitimately signed files whose root is missing from that list, e.g. an Indigo Rose binary signed through COMODO and rooted at UTN-USERFirst-Object.

This only flags a self-signed certificate that issued none of the other certificates in the chain, i.e. the signer itself, for both digital_signers and the guest's signtool chain (guest_signers).

Testing: over 31 reports from a production CAPEv2, the false positive above goes away and the four real hits remain: single self-signed certificates under made-up company names.

A root CA signs itself, so every complete chain holds a self-signed
certificate, and pe_cert_self_signed flagged it unless its name was in
KNOWN_CA_TERMS. Now that digital_signers is filled again it fired on
legitimately signed files whose root is missing from that list: an
Indigo Rose binary signed through COMODO, rooted at
UTN-USERFirst-Object.

Only flag a self-signed certificate that issued none of the others in
the chain, for both digital_signers and the guest's signtool chain.
Over 31 reports from a production CAPEv2 this drops that one false
positive and keeps the four real ones, single self-signed certificates
under made-up company names.
@doomedraven
doomedraven merged commit 0f84383 into CAPESandbox:master Sep 25, 2026
2 checks passed
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 this pull request may close these issues.

2 participants