# CVE-2021-43781: Permissions not properly checked in Invenio-Drafts-Resources

> Authenticated users can publish other users' draft records via REST API due to missing permission checks, allowing unauthorized state changes.

- **Severity:** Medium 6.4 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Dec 2021
- **Updated:** 4 Aug 2024
- **Also known as:** GHSA-xr38-w74q-r8jv, PYSEC-2021-836, PYSEC-2021-837, PYSEC-2021-838

## What is CVE-2021-43781?

CVE-2021-43781 is a medium-severity missing authorization vulnerability in inveniosoftware invenio-drafts-resources, published on 6 Dec 2021. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Invenio-Drafts-Resources is a submission/deposit module for Invenio, a software framework for research data management. Invenio-Drafts-Resources prior to versions 0.13.7 and 0.14.6 does not properly check permissions when a record is published. The vulnerability is exploitable in a default installation of InvenioRDM. An authenticated a user is able via REST API calls to publish draft records of other users if they know the record identifier and the draft validates (e.g. all require fields filled out). An attacker is not able to modify the data in the record, and thus e.g. *cannot* change a record from restricted to public. The problem is patched in Invenio-Drafts-Resources v0.13.7 and 0.14.6, which is part of InvenioRDM v6.0.1 and InvenioRDM v7.0 respectively.

Weakness: CWE-863 (Incorrect Authorization), CWE-862 (Missing Authorization)

## Which versions are affected by CVE-2021-43781?

15 open source packages ship an affected version, including invenio-drafts-resources, invenio-app-rdm and invenio-rdm-records. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `invenio-drafts-resources` | PyPI | All versions | 0.13.7, 0.14.6 |
| `invenio-drafts-resources` | PyPI | All versions | 0.13.7 |
| `invenio-drafts-resources` | PyPI | All versions | 0.13.7 |
| `invenio-drafts-resources` | PyPI | From 0.14.0 | 0.14.6 |
| `invenio-drafts-resources` | PyPI | From 0.14.0 | 0.14.6 |
| `invenio-app-rdm` | PyPI | All versions | 6.0.5, 7.0.0.dev5 |
| `invenio-app-rdm` | PyPI | All versions | 6.0.5 |
| `invenio-app-rdm` | PyPI | All versions | 6.0.5 |
| `invenio-app-rdm` | PyPI | From 7.0.0.dev0 | 7.0.0.dev5 |
| `invenio-app-rdm` | PyPI | From 7.0.0.dev0 | 7.0.0.dev5 |
| `invenio-rdm-records` | PyPI | All versions | 0.32.6, 0.33.10 |
| `invenio-rdm-records` | PyPI | All versions | 0.32.6 |
| `invenio-rdm-records` | PyPI | All versions | 0.32.6 |
| `invenio-rdm-records` | PyPI | From 0.33.0 | 0.33.10 |
| `invenio-rdm-records` | PyPI | From 0.33.0 | 0.33.10 |

Products: Inveniosoftware Invenio-Drafts-Resources.

## How do I fix CVE-2021-43781?

Upgrade invenio-drafts-resources to a fixed version for your release line: 0.13.7 or 0.14.6.

## Is CVE-2021-43781 being exploited?

There is no known exploitation of CVE-2021-43781 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-43781 and fix it if it is affected.

What it is: CVE-2021-43781 is a medium-severity missing authorization vulnerability in inveniosoftware invenio-drafts-resources, published on 6 Dec 2021. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-43781 in the wild and no public exploit code.

Affected packages and fixed versions:
- invenio-drafts-resources (PyPI): affected all versions; fixed in 0.13.7, 0.14.6
- invenio-drafts-resources (PyPI): affected all versions; fixed in 0.13.7
- invenio-drafts-resources (PyPI): affected all versions; fixed in 0.13.7
- invenio-drafts-resources (PyPI): affected from 0.14.0; fixed in 0.14.6
- invenio-drafts-resources (PyPI): affected from 0.14.0; fixed in 0.14.6
- invenio-app-rdm (PyPI): affected all versions; fixed in 6.0.5, 7.0.0.dev5
- invenio-app-rdm (PyPI): affected all versions; fixed in 6.0.5
- invenio-app-rdm (PyPI): affected all versions; fixed in 6.0.5
- invenio-app-rdm (PyPI): affected from 7.0.0.dev0; fixed in 7.0.0.dev5
- invenio-app-rdm (PyPI): affected from 7.0.0.dev0; fixed in 7.0.0.dev5
- invenio-rdm-records (PyPI): affected all versions; fixed in 0.32.6, 0.33.10
- invenio-rdm-records (PyPI): affected all versions; fixed in 0.32.6

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-43781/ (Markdown: https://insights.sbomify.com/CVE-2021-43781/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-43781
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-43781
- OSV: https://osv.dev/vulnerability/CVE-2021-43781

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-43781/
Summaries are generated and may contain mistakes; the official description above is the record.
