Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
CTjs is a full set of classes necessary to work with any kind of Certificate Transparency log (V1 as from RFC6962, or V2 as from RFC6962-bis). In CTjs you could find all necessary validation/verification functions for all related data shipped with full-fe
CTjs is a full set of classes necessary to work with any kind of Certificate Transparency log (V1 as from RFC6962, or V2 as from RFC6962-bis). In CTjs you could find all necessary validation/verification functions for all related data shipped with full-featured examples showning how to validate/verify. Also in scope of CTjs I made code showing example from RFC6962 item 2.1.3 on a real data from real Certificate Transparency log.
npm install ctjs
At the moment there are two examples:
npm run ct-monitor-auditor-example
npm run rfc6962-example
There are both built as Mocha tests, but could be easily transformed in native Node.js application.
const sth = await log.get_sth();
const sthVerificationResult = await sth.verify(log.key);
const sctForVerification = sctFromCertificate(entry.leaf.entry.signedEntry, sct.logID);
if(sctForVerification !== null)
{
const issuer = await findIssuer(entry.leaf.entry.signedEntry, entry.extra_data);
const preCertificate = await PreCert.fromCertificateAndIssuer({
certificate: entry.leaf.entry.signedEntry,
issuer: issuer
});
const sctVerificationResult = await sctForVerification.verify(preCertificate.buffer, log.key, LogEntryType.constants("precert_entry"));
}
sct = await log.add_pre_chain([
entry.extra_data.pre_certificate,
...entry.extra_data.precertificate_chain
]);
const issuer = await findIssuer(entry.extra_data.pre_certificate, entry.extra_data.precertificate_chain);
const preCert = await PreCert.fromCertificateAndIssuer({
certificate: entry.extra_data.pre_certificate,
issuer
});
data = preCert.buffer;
const sctVerificationResult = await sct.verify(
data,
log.key,
entry.leaf.entry.entryType
);
const proof_d0 = await log.get_proof_by_hash(entries[0].leaf, 7);
const verificationProof_d0 = await utils.verifyInclusionProof(
stringToArrayBuffer(fromBase64(a)),
0,
7,
stringToArrayBuffer(fromBase64(hash)),
proof_d0.audit_path
);
const consistency1_7 = await log.get_sth_consistency(1, 7);
const verificationConsistency1_7 = await utils.verifyConsistency(
1,
stringToArrayBuffer(fromBase64(a)),
7,
stringToArrayBuffer(fromBase64(calculatedRootHashesBase64[5])),
consistency1_7
);
At the moment code in CTjs uses 32-bit binary operations. That is why currectly CTjs limited working only with "tree size < 2^32". Having CTjs code to work with bigger sizes is a subject for future development. Also need to say that I do not expect any real Certificate Transparency log to operate more than 4 billion entries in next few years - it is too hard to operate with such huge database, usually CT log would end its life at some tree size and new CT log would be launched. Thus you should not worry about CTjs limitations - all would work fine at least few years.
Copyright (c) 2018 Yury Strozhevsky. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FAQs
CTjs is a full set of classes necessary to work with any kind of Certificate Transparency log (V1 as from RFC6962, or V2 as from RFC6962-bis). In CTjs you could find all necessary validation/verification functions for all related data shipped with full-fe
The npm package ctjs receives a total of 39 weekly downloads. As such, ctjs popularity was classified as not popular.
We found that ctjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.