Authentication Bypass by Primary Weakness Affecting github.com/mojocn/base64captcha package, versions <1.3.6


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.09% (42nd 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 IDSNYK-GOLANG-GITHUBCOMMOJOCNBASE64CAPTCHA-6120445
  • published12 Dec 2023
  • disclosed11 Dec 2023
  • creditcangkuai

Introduced: 11 Dec 2023

CVE-2023-45292  (opens in a new tab)
CWE-305  (opens in a new tab)

How to fix?

Upgrade github.com/mojocn/base64Captcha to version 1.3.6 or higher.

Overview

github.com/mojocn/base64Captcha is an a flexible and various captcha package.

Affected versions of this package are vulnerable to Authentication Bypass by Primary Weakness via the default implementation of Verify to check a Captcha. An attacker can bypass the verification process by providing a non-existent id as the first parameter, an empty string as the second parameter, and setting the third parameter to true, which incorrectly results in the Captcha being considered correct.

PoC

package main

import (
    "fmt"
    "strconv"
    "testing"

    "github.com/mojocn/base64Captcha"
)

func TestCat(t *testing.T) {
    var store = base64Captcha.DefaultMemStore
    fmt.Println(strconv.FormatBool(store.Verify("dsad", "", true)))
}

CVSS Scores

version 3.1