PHPackages                             rootshell/cvss-calculator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. rootshell/cvss-calculator

ActiveLibrary[Security](/categories/security)

rootshell/cvss-calculator
=========================

A PHP library for calculating CVSS security scores.

1.5.1(10mo ago)1102.7k↓17.2%3MITPHPPHP ^8.2 || ^8.3 || ^8.4CI passing

Since Aug 30Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/Rootshell-Security/cvss-calculator)[ Packagist](https://packagist.org/packages/rootshell/cvss-calculator)[ Docs](https://github.com/Rootshell-Security/cvss-calculator)[ RSS](/packages/rootshell-cvss-calculator/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (18)Used By (0)

rootshell/cvss-calculator
=========================

[](#rootshellcvss-calculator)

[![Source Code](https://camo.githubusercontent.com/c1df21c882926f7f937de56e43b371b5839ed076ee37f31ce7b668e30e5b8913/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d726f6f747368656c6c2f637673732d2d63616c63756c61746f722d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/Rootshell-Security/cvss-calculator)[![Latest Version](https://camo.githubusercontent.com/e43537318fdf1db29fe27e5c429194306a5f3d94c579be9d7dd431b820e7296f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f6f747368656c6c2f637673732d63616c63756c61746f722e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/rootshell/cvss-calculator)[![Software License](https://camo.githubusercontent.com/45422066125dac25f56092c2bf18ebcead674ed41df7a3004ae54937a1060a8d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f726f6f747368656c6c2f637673732d63616c63756c61746f722e7376673f7374796c653d666c61742d737175617265)](https://github.com/Rootshell-Security/cvss-calculator/blob/master/LICENSE)[![PHP Version](https://camo.githubusercontent.com/51b504ae429b4883dd85cb2ea1aa28fcf7928fa404bc112a9ad9c52de0ff63aa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f726f6f747368656c6c2f637673732d63616c63756c61746f722e7376673f7374796c653d666c61742d737175617265)](https://php.net)[![Coverage Status](https://camo.githubusercontent.com/1070469f63fc12a815aa387c3e054df8a478441216713ddbebe0edd40b8bbb5e/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6769746875622f526f6f747368656c6c2d53656375726974792f637673732d63616c63756c61746f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/Rootshell-Security/cvss-calculator?branch=master)[![Build](https://camo.githubusercontent.com/62ac81defda658f744330cc290ebaac7d744162e048ae03e1a804554f46f9774/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f526f6f747368656c6c2d53656375726974792f637673732d63616c63756c61746f722f4275696c642f6d61737465723f7374796c653d666c61742d737175617265)](https://github.com/Rootshell-Security/cvss-calculator/actions?query=event%3Apush+workflow%3ABuild+branch%3Amaster)

rootshell/cvss-calculator is a PHP library for translating a CVSS security vector into its relative score. Current support is for CVSS2, CVSS3, CVSS3.1 and CVSS4.0.

This project adheres to a [Contributor Code of Conduct](https://github.com/Rootshell-Security/cvss-calculator/blob/master/.github/CODE_OF_CONDUCT.md). By participating in this project and its community, you are expected to uphold this code.

Installation
------------

[](#installation)

The preferred method of installation is via [Composer](http://getcomposer.org/). Run the following command to install the package and add it as a requirement to your project's `composer.json`:

```
composer require rootshell/cvss-calculator
```

Usage
-----

[](#usage)

The Cvss calculator can be called statically and pass a CVSS string. A CvssResult Object will be returned with the three result types.

If the vector is invalid A CvssException will be thrown.

```
use Rootshell\Cvss\Cvss;
use Rootshell\Cvss\Exceptions\CvssException;

try {
$result = Cvss::generateScores('CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H');
} catch (CvssException $e) {
    return 'Error!';
}

echo $result->baseScore; // 8.0
echo $result->temporalScore; // 8.0
echo $result->environmentalScore; // 8.0
```

Copyright and License
---------------------

[](#copyright-and-license)

The rootshell/cvss-calculator library is copyright © [Rootshell Security LTD](https://www.rootshellsecurity.net/) and licensed for use under the MIT License (MIT). Please see [LICENSE](https://github.com/Rootshell-Security/cvss-calculator/blob/master/LICENSE) for more information.

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance54

Moderate activity, may be stable

Popularity36

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 94.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~160 days

Recently: every ~142 days

Total

12

Last Release

319d ago

PHP version history (4 changes)1.0.0PHP ^7.4 || ^8

1.2.0PHP ^8.0 || ^8.1 || ^8.2

1.4.0PHP ^8.1 || ^8.2 || ^8.3

1.5.0PHP ^8.2 || ^8.3 || ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/99cec26a1f3a77cd6fd5bd5d7e58f6a0f172e308e512e1ac9fd604ecfb5449c7?d=identicon)[LiamPigInTheCity](/maintainers/LiamPigInTheCity)

---

Top Contributors

[![liamh101](https://avatars.githubusercontent.com/u/3386345?v=4)](https://github.com/liamh101 "liamh101 (17 commits)")[![rootshell-cknight](https://avatars.githubusercontent.com/u/156786592?v=4)](https://github.com/rootshell-cknight "rootshell-cknight (1 commits)")

---

Tags

securitycalculatorcvss

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rootshell-cvss-calculator/health.svg)

```
[![Health](https://phpackages.com/badges/rootshell-cvss-calculator/health.svg)](https://phpackages.com/packages/rootshell-cvss-calculator)
```

###  Alternatives

[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k434.8M1.3k](/packages/phpseclib-phpseclib)[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41478.1M118](/packages/robrichards-xmlseclibs)[voku/anti-xss

anti xss-library

72317.1M77](/packages/voku-anti-xss)[spatie/laravel-csp

Add CSP headers to the responses of a Laravel app

8569.6M19](/packages/spatie-laravel-csp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
