Source intelligence
Cryptography analysis reference
This page lists what the cryptography analysis of nightvision openapi extract reads, how it judges committed trust stores, what it does not report, and the format of the report file. To run the analysis and work with its findings, see Post-quantum readiness. This page describes CLI 0.26.0.
What the analysis covers
Section titled “What the analysis covers”Cryptography in code
Section titled “Cryptography in code”The analysis follows the values your code hands to cryptographic APIs, as it follows route paths and parameters. It reports the algorithm, mode, padding, key size, curve, iteration count, password-hashing cost, protocol version, cipher suite or verification setting that reaches a call that takes one. It also reports a weak value that an API uses by default when the code does not set one, and the default of an environment variable read, such as os.getenv("JWT_ALGORITHM", "RS256"), because the deployment may leave that variable unset.
In C# and JVM sources (Java, Kotlin, Scala and Groovy), a statement that turns off a certificate revocation check the platform would otherwise make is reported at low severity: X509RevocationMode.NoCheck assigned to a RevocationMode property, or PKIXParameters.setRevocationEnabled(false). A setting that only restates the platform’s default, such as CheckCertificateRevocationList = false, is not reported.
The language analyzers model the cryptography of each language’s standard libraries and popular packages:
| Language | Libraries and frameworks read |
|---|---|
| C# | .NET cryptography, TLS and HttpClient settings, ASP.NET Web.config and ASP.NET Core settings, ASP.NET Core key derivation, IdentityModel and JWT, OpenIddict, Duende IdentityServer, BouncyCastle, database connection strings, MailKit |
| Go | crypto/*, crypto/tls, crypto/x509, golang.org/x/crypto (including SSH), JWT libraries (golang-jwt, go-jose, jwx), and the JWT middleware of Chi, Echo and Fiber |
| Java | JCA and JSSE, HTTP clients (Apache HttpClient, OkHttp), Spring and Spring Security, Micronaut, and JWT libraries (Auth0 java-jwt, JJWT, Nimbus JOSE) |
| JavaScript and TypeScript | Node crypto, Web Crypto, tls and https, crypto-js, bcrypt, argon2, and JWT libraries and middleware (jsonwebtoken, jose, fast-jwt, passport-jwt, express-jwt, NestJS, Fastify, Hono) |
| PHP | hash, OpenSSL, sodium, password_hash, mcrypt, cURL and streams, Guzzle, phpseclib, mailers, JWT libraries (firebase/php-jwt, lcobucci/jwt, tymon/jwt-auth), Laravel and Symfony |
| Python | hashlib, hmac, ssl, cryptography, PyCryptodome, passlib, HTTP clients, JWT libraries (PyJWT, python-jose, jwcrypto), Django and Flask |
| Ruby | Digest, OpenSSL (including SSLContext), Net::HTTP and open-uri, HTTP clients (Faraday, HTTParty, RestClient, Excon, Typhoeus), RbNaCl and ed25519, bcrypt, JWT libraries (ruby-jwt, json-jwt, jose), Rails and its mailer settings, Devise, devise-jwt and Doorkeeper |
Cryptography in configuration
Section titled “Cryptography in configuration”Framework settings that select an algorithm are reported where the setting is written. This covers settings in code, such as Django’s PASSWORD_HASHERS or Flask-JWT-Extended’s JWT_ALGORITHM, and in the application configuration files a framework reads, such as Spring’s application*.yml and application*.properties or ASP.NET’s appsettings*.json and Web.config. A setting in a profile or environment variant, such as application-dev.yml, appsettings.Development.json or Rails’ config/environments/development.rb, is reported too, and the finding names the profile, since it may not be the choice production makes.
Committed files
Section titled “Committed files”Every project, whatever its language, is also checked for:
- Keys and certificates: the algorithm and size of committed private and public keys, SSH public keys, and certificates and certificate requests, including each kind of certificate in a CA bundle. A finding records the algorithm, size, curve and signature hash, and for a certificate its subject, issuer and expiry date. It never contains key material.
- Keystores: the certificates and private keys of PKCS #12 files and Java keystores (
*.p12,*.pfx,*.jks,*.keystore,*.truststoreandcacerts), assessed as PEM files are. A keystore is read when it opens with no password or with a default that tools write, such aschangeit. The finding says which of the two opened it and never the password. The trusted certificates of a Java keystore are read whatever its password. The private keys of a keystore that opens are also listed in the hardcoded credentials report. - Recoverable keys: every committed key is checked, from its public half alone, for a flaw that lets anyone compute the private key: an elliptic-curve key with a very small private scalar, an RSA modulus with a small prime factor or with primes close enough to factor, and the ROCA fingerprint (CVE-2017-15361). Such a key is broken, at high severity. Treat it as public: replace the key pair and revoke the certificates issued for it or under it.
- Distrusted CAs and stale trust stores: committed CA certificates are judged against the Mozilla root store and a catalog of CAs that root programs distrust. The certificate or key of a CA whose key is compromised is reported at high severity wherever it is committed. A committed CA bundle, such as a vendored
cacert.pem, is reported once as a stale trust store when it still trusts a root that Mozilla no longer trusts for TLS and that either has a compromised CA chaining to it (high) or was removed for cause (medium). The finding names those roots, the compromised CAs they admit, and the first file that loads the bundle. A bundle that only lags routine removals raises no finding, and a private CA is not judged. See Trust stores. - Root store packages and runtimes: the release of a package or runtime that supplies a client’s roots, judged by the roots that release ships. This covers certifi (an exact pin in a requirements file, or
poetry.lock,pdm.lock,uv.lockandPipfile.lock), composer/ca-bundle (composer.lock), webpki-roots (Cargo.lock), and Node.js (theFROM nodeline of a Dockerfile, or.nvmrcand.node-versionwhere no Dockerfile sets the release). A release whose roots admit a compromised CA is medium, and the finding names the first release that does not. One that holds a root removed for cause is low. A Node.js release line that has reached its end of life is noted at info severity, as is composer/ca-bundle unless the code asks for its bundled roots, because it otherwise uses them only where the system has none. - TLS configuration files: the protocol and cipher directives of nginx and Apache configuration files, the obsolete
Expect-CTheader they send, and the minimum protocol and cipher string of OpenSSL configuration files. - Cryptography libraries: a direct dependency on a cryptography library outside NightVision’s approved set, such as CryptoJS, PyCrypto or mcrypt, read from the manifests that ship:
requirements*.txt,pyproject.toml,Pipfile,package.json,composer.json,Gemfile,go.mod,pom.xml,build.gradleand .NET project files. Development and test dependencies are not read. - Library readiness: every cryptography library a project uses, with the version it resolves to, read from lock files where they exist. Each library gets a verdict: ready when that version supports a hybrid post-quantum key exchange, upgrade available when a later version does, or no PQC path when none does. This tells you whether a fix is an upgrade or a rewrite. Examples of versions that are ready: Go 1.24, OpenSSL 3.5 and .NET 10.
- Hand-written algorithms: an implementation of a standard algorithm, such as MD5, SHA-1, SHA-256, AES, DES or ChaCha20, recognized by its constants in any common source file. A validated library is the safer choice.
Trust stores
Section titled “Trust stores”A client outside the browsers trusts the CAs its trust store holds, and many applications commit that store or pin the package that carries it. Such a store keeps trusting a CA long after the browsers stop, since few of these clients check revocation. A client whose store still trusts a root behind a compromised CA accepts whatever certificate the holder of that CA’s key signs.
The analysis judges every committed file whose certificates are all CA certificates as a trust store, against the Mozilla root store’s TLS trust, which most vendored bundles copy. The catalog it uses is generated from Mozilla’s included and removed root reports in the Common CA Database (CCADB), the registry root programs use to record the CAs they trust, from Mozilla’s OneCRL, and from a curated list of compromises and removals for cause, among them DigiNotar, Symantec, WoSign and StartCom, TrustCor, and the eMudhra intermediate CAs whose keys were found recoverable in 2026. The catalog ships with the CLI, so the analysis runs offline and gives the same answer on every run. The report’s trustCatalog.date says when its sources were read.
The report’s trust summary lists every committed trust store, with or without a finding, so you can see where your clients take their trust from:
| Status | Meaning |
|---|---|
current |
Every root the catalog knows is one Mozilla trusts for TLS. |
lagging |
The store holds roots Mozilla no longer trusts, none of them behind a compromise or removed for cause. No finding is raised. |
stale |
The store holds a root that a compromised CA chains to, or one removed for cause. This is the stale trust store finding. |
private |
The store holds no root the catalog knows, as for a private CA. Pointing a client at a private CA is good practice. |
For a store of public roots, the summary also lists its loaders: the source and configuration files that name the bundle by its path or file name, such as ca_file: config/cacert.pem. A stale trust store that no file names is reported for review, with heuristic confidence in the report, since nothing shows that a client loads it. To clear a stale trust store finding, refresh the bundle from a current CA extract or use the system store. For a package or runtime, upgrade to the fixed release the finding names, or later.
What is not reported
Section titled “What is not reported”- Values the code does not show. A choice read from the environment with no default, from a file, from a secrets manager, or supplied by
nv.configis not reported, because the source does not establish it. - Code the analysis does not reach. A call is read only where the analysis walks: from a route, an entry point, or the module it is written in. A call in a function nothing reaches, such as a background job or a management command, may be missed.
- Branches are not told apart. A setting made under a condition counts as made, so
if strict: ctx.check_hostname = Truecounts as turning the host name check on. - Cryptography libraries that another dependency pulls in. The approved-set check judges a manifest’s direct dependencies only.
- Keystores that need a project password. A PKCS #12 file that neither no password nor a default one opens is not read, nor are the private keys of such a Java keystore. JCEKS and BKS stores are not read.
- Other root stores. Root store packages and runtimes beyond those listed above, such as the Go toolchain’s own roots, are not judged. A version range, such as
certifi>=2019.11.28, is not resolved, and neither is a Node.js image named by a Compose file, a CI configuration or a build argument. - CAs distrusted since the catalog was built. The catalog of distrusted CAs ships with the CLI, so the analysis is as current as the CLI that runs it. Upgrade the CLI to pick up a newer catalog.
A finding on a line that a developer marked for another tool, such as nosemgrep, nosec, NOSONAR or lgtm, is still reported, and the report records the marker, so you can see what was accepted elsewhere.
Report file reference
Section titled “Report file reference”The local report is useful in automation, for example to fail a pipeline on high-severity findings. It looks like this:
{ "format": "nightvision.weak-cryptography", "version": 4, "producer": "api-excavator", "catalogVersion": 5, "trustCatalog": { "date": "2026-10-22", "sources": [ "https://ccadb.my.salesforce-sites.com/mozilla/IncludedCACertificateReportCSVFormat", "https://ccadb.my.salesforce-sites.com/mozilla/RemovedCACertificateReportCSVFormat", "https://firefox.settings.services.mozilla.com/v1/buckets/security-state/collections/onecrl/records" ] }, "trust": { "stores": [] }, "complete": true, "summary": { "findings": 1, "severities": { "medium": 1 }, "weaknesses": { "misuse": 1 } }, "findings": [ { "id": "9a38c22a47902bf2", "fingerprint": "7909b03317fef04c", "rule": "python.pycryptodome.mode", "source": "code", "language": "Python", "location": { "file": "app.py", "line": 29, "column": 13 }, "scope": "seal", "primitive": "cipher-mode", "algorithm": "ECB", "attributes": { "cipher": "AES" }, "severity": "medium", "confidence": "high", "issues": [ { "weakness": "misuse", "severity": "medium", "reason": "ECB encrypts equal blocks to equal ciphertext, so it leaks the plaintext's structure; NIST SP 800-131A Rev. 3 disallows it for encryption.", "remediation": "Use an authenticated mode such as AES-GCM.", "reference": "https://csrc.nist.gov/pubs/sp/800/131/a/r3/ipd" } ] } ]}| Field | Meaning |
|---|---|
version, catalogVersion |
The version of the report layout and of the classification that rated the findings. Check both before you parse a report in automation. |
trustCatalog |
The date of the catalog of distrusted CAs that certificates and trust stores were judged against, and the sources it was generated from. |
trust |
The trust summary: each committed trust store with its file, its status (current, lagging, stale or private), counts of its trusted and untrusted roots, and the loaders that name it. See Trust stores. |
complete, gaps |
Whether the report covers everything the run analyzed; when it does not, gaps lists the reasons. |
summary |
Findings counted by severity and by weakness. |
rule |
What found it: <language>.<library>.<parameter> for code and configuration, or file.<kind> for a committed file. |
source |
code, config (a framework setting) or file (a committed file). |
location, scope |
Where the choice is written, and the function or class around it. |
sinks |
Where the analysis saw the choice used, when that is elsewhere. |
operations |
The API operations whose handlers reach the choice, each with its method, path and operationId. |
primitive, algorithm, parameters |
The role the choice plays (hash, cipher-mode, signature, protocol, trust-store, …), what was chosen, and details such as keySize, curve or iterations. For a recoverable key, flaw names what gives the private key away. For a distrusted CA or a stale trust store, distrust is compromise or for-cause. |
attributes |
Context, such as the setting a value is held under, default when the value is an API’s default, profile for a configuration profile, or suppressed for a marker another tool reads. A committed certificate has its subject, issuer and notAfter. A keystore entry has its type and how the store opened (password: none or default). A stale trust store has the roots that make it stale, the compromised CAs it admits and the event behind them (distrust, distrustReference). A root store package or runtime also has its ecosystem, the version written, the release it resolved to and the fixed release. |
confidence |
high when a rule decides the finding, or heuristic when it is for review: a stale trust store that no file names, a Node.js release that only a version file names, and a revocation check turned off. |
severity, issues |
The worst issue’s severity, and each issue’s weakness, reason, remediation and reference, with NIST’s deprecatedAfter and disallowedAfter years where scheduled. |
fallbackFor |
The environment variables whose default the value is. |
id, fingerprint |
Identifiers. The fingerprint leaves out the line, so it survives edits elsewhere in the file. It also leaves out the judgements a catalog can change (flaw, distrust, fallback, endOfLife), so a finding keeps its identity when a newer catalog rates it differently. |