I have been doing some research recently and discovered a Chinese company offering various online tools for SSL certificates. Among which, I noticed its CSR generation tool and it reminded me of the discussions the community had before on certificate resellers and key security. https://groups.google.com/g/mozilla.dev.security.policy/c/Xio6mrdxp2M/m/m38TJkblAgAJ
This vendor provides CSR creation tool with two methods, online generation and browser generation. However, I'm not yet pretty sure about its implementation details and whether they will store the private keys generated.
CSR Creation Tool:
https://tools.imtrust.cn/#/cert-utils/csr_create.html

Online Toolbox:
https://tools.imtrust.cn/#/home

I further checked the domain imtrust.cn and discovered an SSL online purchase platform https://order.imtrust.cn/ under this domain. And the vendor was found to be SHECA, a trusted CA and full member of CABF.
It shows that, the order placement page also offers the option of CSR online generation. https://order.imtrust.cn/

This situation might be different from the previous discussion on reseller generating key pairs on behalf of end customers. Because SHECA is operating as a CA and offers CSR online generation tool.
I'm not sure whether this site has been included into the audit scope and whether its operation and data protection schemes have been propoerly reviewed. It is also not clear that whether this practice violates the requirements of BR 6.1.1.3.
I'd like to discuss this situation together and also request SHECA to provide a response regarding this matter.
Hi, Lambert.
Thank you very much for your report. I will be responding to this incident on behalf of SHECA. SHECA is currently conducting an internal investigation and will respond to this matter as soon as possible.
Best Regards,

--
You received this message because you are subscribed to the Google Groups "dev-secur...@mozilla.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dev-security-po...@mozilla.org.
To view this discussion visit https://groups.google.com/a/mozilla.org/d/msgid/dev-security-policy/bfae9a93-9de6-4e43-8530-da95fef66c2an%40mozilla.org.
Thanks for sharing the details and code.
From my perspective, this isn’t inherently non-compliant with the TLS Baseline Requirements. The relevant section is 6.1.1.3 – Subscriber Key Pair Generation:
6.1.1.3 Subscriber Key Pair Generation
If the CA generates the Key Pair on behalf of the Subscriber, then the CA SHALL NOT archive the Subscriber Private Key. The CA SHALL encrypt the Subscriber Private Key for transport to the Subscriber. The CA SHALL NOT have access to the Subscriber's Private Key once the Subscriber has taken possession of it.
If the Subscriber generates the Key Pair, the CA MUST use a process that verifies that the Key Pair meets the minimum requirements of Section 6.1.5 and SHALL reject CSRs that are incapable of being used to issue a certificate that complies with these Requirements.
Nothing in the BRs prohibits a CA from distributing software or code that performs client-side key generation. A JavaScript-based CSR tool isn’t automatically out of scope.
However, this implementation is not production-grade:
Weak entropy fallback, the code relies on jsrsasign for key generation. While modern browsers support window.crypto.getRandomValues(), the implementation lacks proper handling when this isn’t available. It can silently fall back to weak sources like Math.random() and time-based seeding. The correct behavior is to fail closed if WebCrypto is unavailable.
Hand-rolled JavaScript cryptography is fragile; timing side channels, integer handling quirks, and lack of formal verification introduce significant risk. WebCrypto (SubtleCrypto) exists precisely to avoid these problems, with constant-time native implementations. Not using it means choosing a weaker, more vulnerable approach when a stronger mechanism is built in.
Deprecated code path, the CSR helper shown (CSRUtil.newCSRPEM) is deprecated within jsrsasign. Deprecated paths may contain unserviced security defects or bugs, making them unsuitable for a CA-promoted tool.
Plaintext key delivery, the tool delivers the private key to the user as plaintext PEM. While not strictly prohibited by the BRs when the subscriber generates the key pair, this is risky in practice. Keys left in download folders or synced to backups are routinely lost track of. When we built our STIR/SHAKEN CA at Martini Security, we required encrypted private-key downloads for this reason—it was the only reliable way to prevent inevitable sprawl and exposure.
In my view, the minimum bar for subscriber-side CSR generation should be:
WebCrypto for keygen and entropy (SubtleCrypto.generateKey + crypto.getRandomValues). Fail closed if unavailable.
Encrypted private-key export (PKCS#8 EncryptedPrivateKeyInfo with PBES2/PBKDF2).
Auditable and pinned build: strict CSP, SRI on bundles, offlineable package for transparency.
Reject CSRs that don’t meet minimum key strength per BR 6.1.5.
Bottom line from my perspective is that this isn’t a direct BR violation, but as implemented, it is not the kind of key-generation flow a publicly trusted CA or reseller should provide. If a CA chooses to offer such a tool, it needs to be held to the same standard of care as any other critical part of the certificate issuance process.
Ryan Hurst
--
You received this message because you are subscribed to the Google Groups "dev-secur...@mozilla.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dev-security-po...@mozilla.org.
To view this discussion visit https://groups.google.com/a/mozilla.org/d/msgid/dev-security-policy/c3da349d-3c96-4a6e-8ae9-29e6eaf302b7n%40mozilla.org.
Alan,
I saw an API documentation of SHECA, involving two API paths and parameters related to private key.
In section 3.2 Tools, it describes the function of using API call to generate the CSR online. Both the response parameters and the response examples include information related to the private key.
Request URL:/open-api/v2/tools/gen-csr


In section 3.3.14 Dowload Certificates, the API request parameters also include private key information.
Request URL:/open-api/v2/order/download-zip


I am wondering if these two functions are performed on the server side? Will providing the service in this way pose a security threat to the customer's private key?
Regards.
Alan,
I saw an API documentation of SHECA, involving two API paths and parameters related to private key.
In section 3.2 Tools, it describes the function of using API call to generate the CSR online. Both the response parameters and the response examples include information related to the private key.
Request URL:/open-api/v2/tools/gen-csr


In section 3.3.14 Dowload Certificates, the API request parameters also include private key information.
Request URL:/open-api/v2/order/download-zip


I am wondering if these two functions are performed on the server side? Will providing the service in this way pose a security threat to the customer's private key?
Regards.
Hi Ryan,
The insecure (fallback to math.random() for entropy) and non-production quality of the client-side CSR tool is one thing but if this new information about the server-side API is correct, this represents what I believe to be a direct BR violation.
If correct, your API requires subscribers to POST their private key to your server. This at a minimum suggests a fundamental misunderstanding of a CA's role and the purpose of a CA. The BRs are so predicated on the assumption that CAs understand that good key management requires the subscriber's obligation to protect their own key, the rules don't even explicitly state that a CA should not undermine that obligation. By offering this API, you signal to customers that this dangerous practice is secure, when the CA is supposed to be the expert on these requirements.
Specifically, section 9.6.3 of the Baseline Requirements mandates that CAs require subscribers to agree to the following:
An obligation and warranty by the Applicant to take all reasonable measures to assure control of, keep confidential, and properly protect at all times the Private Key that corresponds to the Public Key to be included in the requested Certificate(s)...
If the thread is correct, your API makes it impossible for a subscriber to uphold this warranty. The defense that "SHECA will not record any user's private key information" is irrelevant. The prohibition is against access, not just storage. This is why for TLS certificates, CAs are not allowed to generate the keys for the subscriber at all. Section 6.1.1.3 states:
If the Subscriber Certificate will contain an
extKeyUsageextension containing either the valuesid-kp-serverAuth[RFC5280] oranyExtendedKeyUsage[RFC5280], the CA SHALL NOT generate a Key Pair on behalf of a Subscriber...
The moment the key hits your server, the associated security properties achieved through those statements are broken.
Again, if true, this server-side API, viewed alongside the client-side code, paints a disturbing picture.
Ryan Hurst
Dear Alvin,
Do I understand correctly that the keypair generated by SHECA in this case is only used to authenticate the customer who wants to access the API? The keypar is not used in any certificate issued by SHECA?
Rgds
Roman
In section 3.3.14 Dowload Certificates, the API request parameters also include private key information.
Request URL:/open-api/v2/order/download-zip
To view this discussion visit https://groups.google.com/a/mozilla.org/d/msgid/dev-security-policy/1fc46c6e-a9d1-42b6-aeaa-8b1b716af271n%40mozilla.org.
Hi Alvin,
To obtain a more complete view of the matter, I purchased an SHECA SSL certificate and discovered several issues:
1.The delivered materials included both public and private key information in multiple certificate formats, which corresponds to the /open-api/v2/order/download-zip interface.

1.1 There was also an instruction txt file that contained a tool guiding customers to upload their private keys for certificate format conversion (certificate installation reference: https://www.yuque.com/sheca/kfxgzb). In one of the pages, it includes an online certificate format conversion tool that receives users’ uploaded private keys. https://www.yuque.com/sheca/kfxgzb/gndrhghm75h205vl



1.2 In your response above, you mentioned only two partners corresponding to two ICAs are using the relevant API
-Xinnet DV SSL
-Xinnet OV SSL
However, it looks like the situation may differ significantly from what you described. Please reconfirm the scope of affected certificates and whether any other interfaces have access to users’ private keys.
I have seen that under the UCA Global G2 Root (https://crt.sh/?caid=36110), there are more than 15 ICAs, including SHECA-branded certificates. And the current observations indicate they all present this risk.


Based on the above information, it is also needed to consider whether the response from the SHECA team is genuine.
2.The interface /open-api/v2/tools/gen-csr, used for generating private keys and CSRs, does provide a newPassword parameter to encrypt the private key, but it is not mandatory. For SHECA certificates applied from its partners, the private keys were encrypted using the default weak password 123456.

3.There was not any Subscriber Agreement during the ordering process.
>These API were authorized by partners when they were provided to them. Furthermore, when partners provided these methods to subscribers, they also signed corresponding subscriber agreements to obtain user authorization. Therefore, SHECA believes that the reason for revocation in this incident does not apply to the third point of 4.9.1.1.
4.Both the /open-api/v2/tools/gen-csr and /open-api/v2/order/download-zip interfaces have access to users’ private keys. How does SHECA ensure that these private keys (CSRs) have not been used to request additional certificates beyond the intended scope? And how will SHECA prevent any continued use of these private keys in the future?
Regards.
