Skip to content

GHSA-ghx2-6v4g-9wmm CVE-2022-4796 GO-2022-1236

usememos/memos makes Incorrect Use of Privileged APIs

High Go
Severity
8.1 / 10
High · CVSS 3.1
Exploit chance (EPSS)
0.81%
Chance of exploitation in the next 30 days. Higher than 56.99% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-648 Incorrect Use of Privileged APIs
Fix
0.9.1
Upgrade github.com/usememos/memos to this version or later

Description

In usememos/memos 0.9.0 and prior, a user with login permission can delete all notes of the whole application via API DELETE https://demo.usememos.com/api/memo/$idnote. The vulnerability will lose all user notes data throughout the system, causing damage to user data.

Affected versions

Go

PackageVulnerableFixed in
github.com/usememos/memos
< 0.9.1
0.9.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

github.com/usememos/memos Go → 0.9.1

go
go get github.com/usememos/memos@v0.9.1 && go mod tidy

Severity breakdown

CVSS 3.1 8.1

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
High

Weakness

CWE-648: Incorrect Use of Privileged APIs

The product does not conform to the API requirements for a function call that requires extra privileges. This could allow attackers to gain privileges by causing the function to be called incorrectly.

How to prevent it
  • Implementation: Before calling privileged APIs, always ensure that the assumptions made by the privileged code hold true prior to making the call.
  • Architecture and Design: Know architecture and implementation weaknesses of the privileged APIs and make sure to account for these weaknesses before calling the privileged APIs to ensure that they can be called safely.
  • Implementation: If privileged APIs make certain assumptions about data, context or state validity that are passed by the caller, the calling code must ensure that these assumptions have been validated prior to making the call.
  • Implementation: If privileged APIs do not shed their privilege prior to returning to the calling code, then calling code needs to shed these privileges immediately and safely right after the call to the privileged APIs. In particular, the calling code needs to ensure that a privileged thread of execution will never be returned to the user or made available to user-controlled processes.
  • Implementation: Only call privileged APIs from safe, consistent and expected state.
  • Implementation: Ensure that a failure or an error will not leave a system in a state where privileges are not properly shed and privilege escalation is possible (i.e. fail securely with regards to handling of privileges).

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-gqp3-hfc3-8q54
Memos has an Incorrect Privilege Assignment issue
Medium Also affects github.com/usememos/memos
GHSA-qgjp-5g5x-vhq2
memos lacks file name validation or verification
Medium Also affects github.com/usememos/memos
GHSA-99m2-qwx6-2w6f
memos vulnerability allows arbitrarily modification or deletion registered identity providers
Medium Also affects github.com/usememos/memos
GHSA-mg56-wc4q-rw4w
memos vulnerability allows the creation of arbitrary accounts
High Also affects github.com/usememos/memos
GHSA-8p44-g572-557h
memos vulnerability allows arbitrarily modification or deletion of attachments
Medium Also affects github.com/usememos/memos
GHSA-8jcj-g9f4-qx42
memos vulnerability allows arbitrarily reactions deletion
Medium Also affects github.com/usememos/memos
GHSA-mr34-8733-grr2
Memos' Access Tokens Stay Valid after User Password Change
High Also affects github.com/usememos/memos
GHSA-cgrg-86m5-xm4w
Memos Vulnerable to Stored Cross-Site Scripting
Medium Also affects github.com/usememos/memos
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor