Improper Validation of Array Index Affecting github.com/greenpau/caddy-security package, versions *


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.05% (17th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-GOLANG-GITHUBCOMGREENPAUCADDYSECURITY-5961078
  • published 16 Feb 2024
  • disclosed 18 Sep 2023
  • credit Maciej Domanski, Travis Peters, David Pokora

How to fix?

There is no fixed version for github.com/greenpau/caddy-security.

Overview

github.com/greenpau/caddy-security is a Security App and Plugin for Caddy v2.

Affected versions of this package are vulnerable to Improper Validation of Array Index when parsing a Caddyfile. Multiple parsing functions in the affected library do not validate whether their input values are nil before attempting to access elements, which can lead to a panic (index out of range). Panics during the parsing of a configuration file may introduce ambiguity and vulnerabilities, hindering the correct interpretation and configuration of the web server.

PoC

func TestCrashCredentialsUsername(t *testing.T) {
    file := caddyfile.NewTestDispenser(string("0 { credentials 0 { username"))
    parseCaddyfile(file, nil)
}

func TestCrashCredentialsDomain(t *testing.T) {
    file := caddyfile.NewTestDispenser(string("0 { credentials 0 { domain"))
    parseCaddyfile(file, nil)
}

func TestCrashSSOProvider(t *testing.T) {
    file := caddyfile.NewTestDispenser(string("00 {  sso provider 0 {  entity_id"))
    parseCaddyfile(file, nil)
}

func TestCrashParseCaddyfileMessaging(t *testing.T) {
    file := caddyfile.NewTestDispenser(string("0 { messaging email provider 0 { address"))
    parseCaddyfile(file, nil)
}

References

CVSS Scores

version 3.1
Expand this section

Snyk

5.3 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    None
  • Integrity (I)
    None
  • Availability (A)
    Low