GHSA-fv6c-rfg3-gvjw CVE-2022-4687 GO-2022-1217
usememos/memos makes Incorrect Use of Privileged APIs
- Severity
- 8.1 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 0.68%
- Chance of exploitation in the next 30 days. Higher than 52.25% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Fix
0.9.0- Upgrade github.com/usememos/memos to this version or later
Description
Incorrect Use of Privileged APIs in GitHub repository usememos/memos prior to 0.9.0.
Affected versions
Go
| Package | Vulnerable | Fixed in |
|---|---|---|
| github.com/usememos/memos | < 0.9.0 |
0.9.0 |
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.0
- go
go get github.com/usememos/memos@v0.9.0 && go mod tidy
Severity breakdown
CVSS 3.1 8.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- None
Weakness
CWE-269: Improper Privilege Management
The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.
How to prevent it
- Architecture and Design, Operation: Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software.
- Architecture and Design: Follow the principle of least privilege when assigning access rights to entities in a software system.
- Architecture and Design: Consider following the principle of separation of privilege. Require multiple conditions to be met before permitting access to a system resource.
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
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why 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 |
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