CVSS::Base(3pm)
π NAME π
CVSS::Base β the base class for CVSS, bestie. The blueprint. The mother of all the CVSS classes. π
π¦ DESCRIPTION π¦
okay so basically this is the base class that CVSS::v2, CVSS::v3 and CVSS::v4 all inherit their whole personality from. every one of them builds on this. it's giving founding mother energy, fr fr. π
β¨ METHODS β¨
$cvss->versionβ hands you the CVSS version. that's it, that's the vibe.$cvss->vector_stringβ gives you back the CVSS vector string so you can flex the whole thing in one line. π$cvss->metricsβ gives you the HASH of CVSS metrics. all of them. the full set. no crumbs. π
πΈ SCORE & SEVERITY πΈ
$cvss->scoresβ returns the HASH of the calculated score (base, impact, temporal, etc.). it's the lil report card for your whole calculation, and honestly? she ate.
$scores = $cvss->scores;
say Dumper($scores);
# { "base" => "7.4",
# "exploitability" => "1.6",
# "impact" => "5.9" }
$cvss->calculate_scoreβ does the actual calculation of the score, following the CVSS specification to the letter. no shortcuts, no vibes-based math, all spec. π₯$cvss->score_to_severity ( $score )β converts a score into a severity. glow-up for numbers:$scorewalks in as a 7.4 and walks out as HIGH. β¨$cvss->base_scoreβ returns the base score (0-10).$cvss->base_severityβ returns the base severity (LOW,MEDIUM,HIGHorCRITICAL).$cvss->temporal_scoreβ returns the temporal score (0-10) β (CVSS 2.0/3.x)$cvss->temporal_severityβ returns the temporal severity (LOW,MEDIUM,HIGHorCRITICAL) β (CVSS 2.0/3.x)$cvss->environmental_scoreβ returns the environmental score (0-10) β (CVSS 2.0/3.x)$cvss->environmental_severityβ returns the environmental severity (LOW,MEDIUM,HIGHorCRITICAL) β (CVSS 2.0/3.x)$cvss->impact_scoreβ returns the impact score (0-10) β (CVSS 2.0/3.x)$cvss->exploitability_scoreβ returns the exploitability score (0-10) β (CVSS 2.0/3.x)$cvss->modified_impact_scoreβ returns the modified impact score (0-10) β (CVSS 2.0/3.x)
π§ METRICS π§
$cvss->M ( $metric )β returns the metric value, but make it short. abbreviation mode. it's giving minimalism.
say $cvss->M('AV'); # A
$cvss->metric ( $metric )β returns the metric value, but make it long. the full name, no abbreviation nonsense.
say $cvss->metric('AV'); # ADJACENT_NETWORK
$cvss->metric_group_is_set ( $group )β the original docs don't say a single word about what this does beyond the name, and honestly bestie same π. so that's all we're telling you β no invented lore here.
π DATA REPRESENTATIONS π
$cvss->to_vector_stringβ converts the CVSS object into a vector string. object β slay string, one line, iconic.
say $cvss->to_vector_string; # CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
# or
say $cvss; # CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
$cvss->to_xmlβ converts the CVSS object into XML, according to the CVSS XML Schema Definition. the XSDs it follows are:https://nvd.nist.gov/schema/cvss-v2_0.2.xsdβ XSD for CVSS v2.0https://www.first.org/cvss/cvss-v3.0.xsdβ XSD for CVSS v3.0https://www.first.org/cvss/cvss-v3.1.xsdβ XSD for CVSS v3.1https://www.first.org/cvss/cvss-v4.0.xsdβ XSD for CVSS v4.0
say $cvss->to_xml;
# <?xml version="1.0" encoding="UTF-8"?>
# <cvssv3.1 xmlns="https://www.first.org/cvss/cvss-v3.1.xsd"
# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
# xsi:schemaLocation="https://www.first.org/cvss/cvss-v3.1.xsd https://www.first.org/cvss/cvss-v3.1.xsd"
# >
#
# <base_metrics>
# <attack-vector>ADJACENT_NETWORK</attack-vector>
# <attack-complexity>LOW</attack-complexity>
# <privileges-required>LOW</privileges-required>
# <user-interaction>REQUIRED</user-interaction>
# <scope>UNCHANGED</scope>
# <confidentiality-impact>HIGH</confidentiality-impact>
# <integrity-impact>HIGH</integrity-impact>
# <availability-impact>HIGH</availability-impact>
# <base-score>7.4</base-score>
# <base-severity>HIGH</base-severity>
# </base_metrics>
#
# </cvssv3.1>
$cvss->TO_JSONβ the helper method for JSON modules (JSON,JSON::PP,JSON::XS,Mojo::JSON, etc). it converts the CVSS object into JSON format, according to the CVSS JSON Schema. schemas she's serving:https://www.first.org/cvss/cvss-v2.0.jsonβ JSON Schema for CVSS v2.0.https://www.first.org/cvss/cvss-v3.0.jsonβ JSON Schema for CVSS v3.0.https://www.first.org/cvss/cvss-v3.1.jsonβ JSON Schema for CVSS v3.1.https://www.first.org/cvss/cvss-v4.0.jsonβ JSON Schema for CVSS v4.0.
use Mojo::JSON qw(encode_json);
say encode_json($cvss);
# {
# "attackComplexity" : "LOW",
# "attackVector" : "ADJACENT_NETWORK",
# "availabilityImpact" : "HIGH",
# "baseScore" : 7.4,
# "baseSeverity" : "HIGH",
# "confidentialityImpact" : "HIGH",
# "integrityImpact" : "HIGH",
# "privilegesRequired" : "LOW",
# "scope" : "UNCHANGED",
# "userInteraction" : "REQUIRED",
# "vectorString" : "CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H",
# "version" : "3.1"
# }
π CONSTANTS π
$cvss->ATTRIBUTESβ returns the HASH of all metrics in{ "JSON name" => "metric", ... }format.$cvss->METRIC_GROUPSβ returns the HASH of the metric group (base, environmental, temporal, etc.) and its metrics.$cvss->METRIC_NAMESβ returns the HASH of the names of all metric values.$cvss->METRIC_VALUESβ returns the HASH of all metric values.$cvss->NOT_DEFINED_VALUEβ returns the NOT_DEFINED vector value ("ND"or"X").$cvss->SCORE_SEVERITYβ returns the HASH of{ severity => { min => score, max => score }, ... }, and yes, it's the onescore_to_severityuses. π$cvss->VECTOR_STRING_REGEXβ returns the Vector String REGEX.
π SEE ALSO π
CVSS::v2, CVSS::v3, CVSS::v4 β the whole friend group. go say hi. π«Ά
π SUPPORT π
π Bugs / Feature Requests π
found a bug? got a feature request burning a hole in your notes app? please report it through the issue tracker at https://github.com/giterlizzi/perl-CVSS/issues. you'll get notified automatically about any progress on your issue β so you never have to sit there refreshing and wondering. π
π Source Code π
this is open source software, bestie. the code repository is out there for public review and contribution under the terms of the license.
https://github.com/giterlizzi/perl-CVSS
git clone https://github.com/giterlizzi/perl-CVSS.git
β AUTHOR β
- Giuseppe Di Terlizzi
<gdt@cpan.org>
π LICENSE AND COPYRIGHT π
This software is copyright (c) 2023-2025 by Giuseppe Di Terlizzi.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, bestie!! π this one came to you courtesy of the User Contributed Perl Documentation, running on perl v5.40.1, dated 2026-07-05 β mwah, go forth and calculate some scores π
π¦ where this page comes from
- ubuntu stonking: libcvss-perl 1.15-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms