A few notes to anons interested in what that CA is, I will just log myself trying to figure it out:
In XPIInstall.jsm, we can see:
Ci.nsIX509CertDB.AddonsPublicRoot might be the public root in question. This root is baked inside xul.dll, but the binary could either be patched or the references inside omni.ja could be patched to use the new one.
Given how some people seem to have trouble with just this and how this could be firefox binary build specific, I don't really feel like going into that, but you'd basicall be running the old firefox, checking the x509 root cert, searching the bytes with a hex editor for the old one, and then the new one (have to run both), then patching it. In the event the length is different, you may have to find a place for a new copy of it, or add a new section to the executable, then insert the code thre and replace the references.
I could do this for a specific binary, but I don't want to hold people's hands for that, just disable addon signing entirely since it's far more convenient anyway.
Also you can debug this, for example, in Firefox's Browser console, you can see:
addons.xpi-utils WARN Add-on uBlock0@raymondhill.net is not correctly signed.
addons.xpi WARN Invalid XPI: signature verification failed
Once I corrupted the signature to test it, it still installed fine!
Setting about:config devtools.chrome.enabled to true, enables evaluating in the browser console, following by reopening it (Ctrl+Shift+J)
Ci.nsIX509CertDB.AddonsPublicRoot has the value 7 here, so it must be an index into some internal certs?
Let's see what the actual class looks like:
let certDB = Cc["@mozilla.org/security/x509certdb;1"].getService()
XPCWrappedNative_NoHelper { openSignedAppFileAsync: openSignedAppFileAsync(), getCerts: getCerts(), QueryInterface: QueryInterface(), findCertByDBKey: findCertByDBKey(), importCertificates: importCertificates(), importEmailCertificate: importEmailCertificate(), importUserCertificate: importUserCertificate(), deleteCertificate: deleteCertificate(), setCertTrust: setCertTrust(), setCertTrustFromString: setCertTrustFromString(), ... }
certDB.QueryInterface(Ci["nsIX509CertDB"])
Now how about those certs?
certDB.QueryInterface(Ci["nsIX509CertDB"]).getCerts()
gives an array of 198 certs. Are these actually managed by NSS' code? So much for supposedly being unreplaceable, because those can be changed, so our index was 7 ( Ci.nsIX509CertDB.AddonsPublicRoot )
so let's try
let somecert = certDB.QueryInterface(Ci["nsIX509CertDB"]).getCerts()[Ci.nsIX509CertDB.AddonsPublicRoot]
Which turned out to be a regular cert, so it's certainly not the right one, so it's time to see what the actual code does:
The actual code calls on the certDB openSignedAppFileAsync to validate the signatures.
Let's see what the C++ code does:
https://searchfox.org/mozilla-central/source/security/manager/ssl/AppSignatureVerification.cpp around line 1263
(other related files https://searchfox.org/mozilla-central/source/security/manager/ssl/nsNSSCertificateDB.h https://searchfox.org/mozilla-central/source/security/manager/ssl/nsIX509CertDB.idl )
There's 2 calls to VerifyPK7Signature and VerifyCoseSignature
On line 1212 we see:
defined in https://searchfox.org/mozilla-central/source/security/manager/ssl/AppSignatureVerification.cpp#750
which calls VerifyCertificate, which loads the certs from https://searchfox.org/mozilla-central/source/security/manager/ssl/AppTrustDomain.cpp#54
let's see what addonsPublicRoots actually is?
we have a DER blob here:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | const uint8_t addonsPublicRoots0[] = {
0x30, 0x82, 0x06, 0x65, 0x30, 0x82, 0x04, 0x4d, 0xa0, 0x03, 0x02,
0x01, 0x02, 0x02, 0x01, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86,
0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0c, 0x05, 0x00, 0x30, 0x7d,
0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
0x55, 0x53, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x0a,
0x13, 0x13, 0x4d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, 0x61, 0x20, 0x43,
0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31,
0x2f, 0x30, 0x2d, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x26, 0x4d,
0x6f, 0x7a, 0x69, 0x6c, 0x6c, 0x61, 0x20, 0x41, 0x4d, 0x4f, 0x20,
0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55,
0x04, 0x03, 0x13, 0x16, 0x72, 0x6f, 0x6f, 0x74, 0x2d, 0x63, 0x61,
0x2d, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x2d, 0x61, 0x6d, 0x6f, 0x30, 0x22, 0x18, 0x0f, 0x32, 0x30, 0x32,
0x34, 0x30, 0x32, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
0x5a, 0x18, 0x0f, 0x32, 0x32, 0x30, 0x30, 0x31, 0x32, 0x30, 0x33,
0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x7d, 0x31, 0x0b,
0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53,
0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x13,
0x4d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, 0x61, 0x20, 0x43, 0x6f, 0x72,
0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x2f, 0x30,
0x2d, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x26, 0x4d, 0x6f, 0x7a,
0x69, 0x6c, 0x6c, 0x61, 0x20, 0x41, 0x4d, 0x4f, 0x20, 0x50, 0x72,
0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x69,
0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04, 0x03,
0x13, 0x16, 0x72, 0x6f, 0x6f, 0x74, 0x2d, 0x63, 0x61, 0x2d, 0x70,
0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x61,
0x6d, 0x6f, 0x30, 0x82, 0x02, 0x20, 0x30, 0x0d, 0x06, 0x09, 0x2a,
0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03,
0x82, 0x02, 0x0d, 0x00, 0x30, 0x82, 0x02, 0x08, 0x02, 0x82, 0x02,
0x01, 0x00, 0xb4, 0xbb, 0x61, 0xd7, 0x5d, 0xba, 0xf0, 0xcb, 0x7e,
0xbe, 0x30, 0xf7, 0x8a, 0x7f, 0x98, 0xe0, 0xa0, 0x04, 0x8c, 0x7c,
0xc3, 0x73, 0xee, 0x62, 0x56, 0x05, 0xe7, 0x09, 0x82, 0xf9, 0x53,
0x7f, 0x88, 0x47, 0x25, 0xb2, 0xf3, 0x30, 0xfb, 0x08, 0x51, 0xab,
0xb3, 0x23, 0xd1, 0x84, 0xa4, 0xb7, 0xc7, 0x75, 0x9e, 0xb0, 0xcd,
0x2c, 0x85, 0x39, 0xbe, 0x00, 0x33, 0xe0, 0xf5, 0x9b, 0x10, 0x16,
0x86, 0xe6, 0x49, 0xdc, 0xc0, 0xc0, 0x24, 0xe7, 0xf7, 0x07, 0x54,
0x6c, 0xe9, 0x0a, 0x2b, 0x1e, 0xb9, 0x7c, 0xaa, 0xa9, 0x4d, 0xb4,
0xf1, 0xaa, 0x7a, 0x99, 0xe9, 0x34, 0x97, 0x0b, 0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0x7a, 0xcd, 0xcb, 0xdf, 0xe4, 0x73, 0x4d, 0xa2, 0x9a,
0x04, 0x76, 0x0e, 0x72, 0xb9, 0x7a, 0x36, 0x72, 0x16, 0x75, 0xa7,
0x52, 0x7e, 0xab, 0xce, 0x9b, 0xd0, 0x6e, 0x72, 0x25, 0x13, 0x1e,
0x4f, 0x6f, 0xa2, 0x39, 0x56, 0x36, 0x11, 0x0d, 0xfb, 0xb4, 0x7a,
0xea, 0x51, 0x44, 0x67, 0x70, 0x2c, 0xb8, 0xbb, 0x02, 0x01, 0x03,
0xa3, 0x81, 0xed, 0x30, 0x81, 0xea, 0x30, 0x0c, 0x06, 0x03, 0x55,
0x1d, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e,
0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03,
0x02, 0x01, 0x06, 0x30, 0x16, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01,
0x01, 0xff, 0x04, 0x0c, 0x30, 0x0a, 0x06, 0x08, 0x2b, 0x06, 0x01,
0x05, 0x05, 0x07, 0x03, 0x03, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d,
0x0e, 0x04, 0x16, 0x04, 0x14, 0xb3, 0xbc, 0xea, 0x58, 0x74, 0xab,
0xe1, 0x6e, 0x78, 0x2a, 0xb2, 0xab, 0x9c, 0x23, 0x1e, 0xa8, 0x63,
0x2c, 0x97, 0xb7, 0x30, 0x81, 0x92, 0x06, 0x03, 0x55, 0x1d, 0x23,
0x04, 0x81, 0x8a, 0x30, 0x81, 0x87, 0xa1, 0x81, 0x81, 0xa4, 0x7f,
0x30, 0x7d, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
0x13, 0x02, 0x55, 0x53, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55,
0x04, 0x0a, 0x13, 0x13, 0x4d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, 0x61,
0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x31, 0x2f, 0x30, 0x2d, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13,
0x26, 0x4d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, 0x61, 0x20, 0x41, 0x4d,
0x4f, 0x20, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x31, 0x1f, 0x30, 0x1d, 0x06,
0x03, 0x55, 0x04, 0x03, 0x13, 0x16, 0x72, 0x6f, 0x6f, 0x74, 0x2d,
0x63, 0x61, 0x2d, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x2d, 0x61, 0x6d, 0x6f, 0x82, 0x01, 0x01, 0x30, 0x0d,
0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0c,
0x05, 0x00, 0x03, 0x82, 0x02, 0x01, 0x00, 0x00, 0x09, 0xb8, 0xdd,
0xb7, 0xa8, 0x38, 0xb2, 0x01, 0x9f, 0x32, 0xf4, 0x38, 0x6a, 0x4d,
0xf2, 0x1f, 0x75, 0x80, 0x57, 0x0b, 0xb8, 0xe0, 0x7f, 0xba, 0x79,
0x0c, 0xd0, 0xa3, 0xea, 0x67, 0x1f, 0x2f, 0x10, 0x8c, 0x2e, 0xe4,
0xaf, 0x2e, 0x58, 0xd8, 0x5a, 0x6d, 0x08, 0x7c, 0x76, 0x2c, 0xe5,
0x6d, 0x25, 0x9d, 0x08, 0x26, 0xf3, 0xe3, 0x74, 0x9b, 0x74, 0x80,
0x8d, 0x07, 0x75, 0xf0, 0x0c, 0xd6, 0x7d, 0x73, 0x64, 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, 0xd1, 0x54, 0x6d, 0x03, 0x08,
0x21, 0x91, 0x6b, 0x28, 0xa0, 0x2a, 0x07, 0x47, 0xef, 0xca, 0x8c,
0x1e, 0x97, 0x57, 0xad, 0xb6, 0x93, 0x0c, 0x5b, 0x1f, 0x30, 0xb4,
0xc0, 0x32, 0x71, 0x85, 0x9e, 0xa3, 0x99, 0x32, 0xe3, 0x28, 0x6c,
0xd2, 0x52, 0xe4, 0xce, 0xbf, 0xbe, 0xa7, 0x5e, 0xa6, 0x80, 0xbc,
0x2f, 0xbc, 0x66, 0x23, 0x97, 0x50, 0x81, 0x6f, 0x18, 0x1b, 0x2c,
0xa6, 0xaf, 0xc0, 0xcf, 0x81, 0xc8, 0x4c, 0xa1, 0xfd, 0x2d, 0xca,
0x58, 0x27
};
const mozilla::Span<const uint8_t> addonsPublicRoots[] = { mozilla::Span(addonsPublicRoots0, sizeof(addonsPublicRoots0)) };
|
Let's see where this ends up in the binary? It should be in xul.dll, and I've confirmed it's the only copy of it:
Inside the binary we see (addresses are Virtual Addresses, not raw file offsets):
... Which seems to be the right cert, ending about here:
But going by the layout in the generated source code, the pointer and size to the certificate should be after this included binary blob, however it's not there, likely the compiler optimized it away?
So I look for a cross-reference in the code:
So if you wanted to patch it, you'd need to patch:
You can probably guess that I have a very low appetite toward making a patcher for this when it'd be very specific to firefox binaries, but you might be able to replace the old cert in memory if the size matches, or are willing to write some dynamic x-ref location logic (might not be reliable).
However, if there is some demand from some anons, I could write some code.
I'd also like to note that patching xul.dll directly will break the EME video DRM as they check file signatures (the .sig file), if you want to patch without breaking support for that, this must be done at runtime with OpenProcess and WriteProcessMemory, or at least, if you don't want to do that, patching the file while retaining DRM capability would be a more involved process that I do not want to go into here.