CVE-2024-40464: Beego privilege escalation vulnerability via sendMail in github.com/beego/beego/v2

github.com/beego/beego/v2 Updated 02 Oct 2025

Summary

19/08/2024
Yes i
High
8.8

CVE-2024-40464: Beego privilege escalation vulnerability via sendMail in github.com/beego/beego/v2. Affects github.com/beego/beego/v2 versions < 2.2.1. Fixed in 2.2.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The package under scrutiny is github.com/beego/beego/v2, which is a Go package for building web applications and APIs. It provides a framework for developing scalable and high-performance applications. The package includes various modules for handling routing, middleware, logging, and more. However, a privilege escalation vulnerability has been identified in the sendMail function of the package.

Vulnerability Detail

The vulnerability in github.com/beego/beego/v2 allows an attacker to escalate their privileges by exploiting the sendMail function. By sending a specially crafted email, an attacker can execute arbitrary code with elevated privileges. This can lead to unauthorized access, data breaches, and potential compromise of the entire system. The vulnerability affects versions 0 to 2.2.1 of the package.

How To Fix

Latest published version: v2.3.10 as of 23 Oct 2026

go get github.com/beego/beego/v2@v2.3.10

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.2.1

This is the first release that contains the fix.

go get github.com/beego/beego/v2@v2.2.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, it is advised to disable the sendMail functionality in the application or implement additional security measures to prevent unauthorized access to the function. Here is an example of how to disable the sendMail function in the code:

package main

import (
	"github.com/beego/beego/v2"
	"github.com/beego/beego/v2/core/logs"
)

func main() {
	// Disable sendMail
	logs.SetLogger(logs.AdapterConsole)
}

Conclusion

The privilege escalation vulnerability in the sendMail function of github.com/beego/beego/v2 can lead to unauthorized access and potential compromise of the system. It is crucial to update the package to version 2.2.1 or higher to mitigate the risk. Additionally, implementing security measures or disabling the sendMail functionality can serve as temporary workarounds.

See every vulnerability recorded for github.com/beego/beego/v2 →

Share this vulnerability

FAQ

The vulnerability allows an attacker to escalate their privileges and execute arbitrary code with elevated access. This can lead to unauthorized access, data breaches, and potential compromise of the entire system.

Versions 0 to 2.2.1 of the github.com/beego/beego/v2 package are affected by this vulnerability.

To fix the vulnerability, update the package to version 2.2.1 or higher. Make sure to recompile and redeploy the application after the update.

As a temporary workaround, you can disable the sendMail functionality in the application or implement additional security measures to prevent unauthorized access to the function.

You can find more information about this vulnerability in the official advisory at https://pkg.go.dev/vuln/GO-2024-3016.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/beego/beego/v2.

How To Fix

Latest published version: v2.3.10 as of 23 Oct 2026

go get github.com/beego/beego/v2@v2.3.10

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.2.1

This is the first release that contains the fix.

go get github.com/beego/beego/v2@v2.2.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback