CPAN-AUDIT(1)
π NAME π
Bestie, welcome to the CPAN-AUDIT(1) manual page from the User Contributed Perl Documentation β aka the cpan-audit manual. cpan-audit audits CPAN modules. Periodt.
β¨ SYNOPSIS β¨
Okay so the whole vibe is:
cpan-audit [command] [options]
Commands:
module[version range]β audit module with optional version range (all by default)modules[version range]β audit module list with optional version range (all by default)dist|release[version range]β audit distribution with optional version range (all by default)deps[directory]β audit dependencies from the directory (.by default)installedβ audit all installed modulesshow[advisory id]β show information about specific advisory
Options:
--asciiβ use ascii output--freshcheck|fβ check the database for freshness (CPAN::Audit::FreshnessCheck)--help|hβ show the help message and exit--no-colorβ switch off colors--no-corelistβ ignore modules bundled with perl version--perlβ include perl advisories--quietβ be quiet (overrules--verbose)--verboseβ be verbose (off if--quietin effect)--versionβ show the version and exit--exclude <str>β exclude/ignore the specified advisory/cve (multiple)--exclude-file <file>β read exclude/ignore patterns from file--jsonβ output JSON
Examples:
cpan-audit dist Catalyst-Runtime
cpan-audit dist Catalyst-Runtime 7.0
cpan-audit dist Catalyst-Runtime '>5.48'
cpan-audit module Catalyst 7.0
cpan-audit modules "Catalyst;7.0" "Mojolicious;>8.40,<9.20"
cpan-audit deps .
cpan-audit deps /path/to/distribution
cpan-audit installed
cpan-audit installed local/
cpan-audit installed local/ --exclude CVE-2011-4116
cpan-audit installed local/ --exclude CVE-2011-4116 --exclude CVE-2011-123
cpan-audit installed local/ --exclude-file ignored-cves.txt
cpan-audit installed --json
cpan-audit show CPANSA-Mojolicious-2018-03
πΈ DESCRIPTION πΈ
cpan-audit is a command line application that checks modules or distributions for known vulnerabilities. It uses its internal database, which is automatically generated from a hand-picked database at https://github.com/briandfoy/cpan-security-advisory.
cpan-audit does not connect to anything β which is exactly why keeping it up to date matters so much. Every update of the internal database is released as a new version. Ensure you have the latest database by updating CPAN::Audit frequently; the database can change daily. You can enable a warning for a possibly out-of-date database by adding --freshcheck, which warns if the database version is older than a month:
% cpan-audit --freshcheck ...
% cpan-audit -f ...
% env CPAN_AUDIT_FRESH_DAYS=7 cpan-audit -f ...
π§ Finding dependencies π§
cpan-audit can automatically detect dependencies from the following sources:
Cartonβ Parsescpanfile.snapshotfile and checks the distribution versions.cpanfileβ Parsescpanfiletaking into account the required versions.
It is assumed that if the required version of the module is less than a version of a release with a known vulnerability fix, then the module is considered affected.
π¦ JSON data π¦
If you request JSON output, the data looks like:
{
"meta" : {
... meta information ...
"dists": {
"<distribution1>": {
... distribution info ...
}
}
"errors" : [
... list of errors - if any ...
]
}
π Meta information π
The meta data contains information about the run of cpan-audit.
{
"args": [
"Mojo::File",
"Mojo::UserAgent",
"LWP::UserAgent"
],
"cpan_audit": {
"version": "20230601.002"
},
"total_advisories": 19,
"command": "modules"
}
These information are shown:
cpan_auditβ The version ofcpan_auditthat is used for the auditcommandβ The command ofcpan_auditthat was runargsβ Arguments for the commandtotal_advisoriesβ Number of found advisories
π Distribution information π
For each distribution where at least one advisory was found, the JSON looks like:
"Dist-Name": {
"queried_modules": [
"Queried::Namespace"
],
"version": "Any",
"advisories": [
{
... advisory data as in the audit database ...
},
... more advisories ...
]
},
The advisory data is basically the data from the database. So this depends on what is known for the given advisory.
The distribution information contains:
versionβ The version (range) that is checked for advisories. If there's no version specified, all versions are checked and the version is reported as"Any".queried_modulesβ The actual namespaces queried, either from the command line or another source, such as acpanfile.advisoriesβ A list of all vulnerabilities found for the version range
π₯ Exit values π₯
In prior versions, cpan-audit exited with the number of advisories it found. Starting with 1.001, if there are advisories found, cpan-audit exits with 64 added to that number. The maximum number of reported advisories is 62, since values over 126 are spoken for.
0β normal operation2β problem with program invocation, such as bad switches or values64+nβ advisories found. Subtract64to get the advisory count, up to62advisories255β program error
π LICENSE π
Copyright (C) Viacheslav Tykhanovskyi.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Byeee bestie! This page comes from perl v5.42.3, dated 2023-08-26, and its manual tag is CPAN-AUDIT(1). Stay patched and hydrated ππ§β¨
π¦ where this page comes from
- nixos 26.05: perl5.42.3-CPAN-Audit 20230826.001
- nixpkgs unstable: perl5.42.3-CPAN-Audit 20230826.001
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms