{"id":"CVE-2021-43781","aliases":["GHSA-xr38-w74q-r8jv","PYSEC-2021-836","PYSEC-2021-837","PYSEC-2021-838"],"title":"Permissions not properly checked in Invenio-Drafts-Resources","summary":"Permissions not properly checked in Invenio-Drafts-Resources","severity":"medium","cvss":6.4,"cvssVector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N","vendor":"invenio-drafts-resources","product":"invenio-drafts-resources","ecosystem":"pip","affected":["invenio-drafts-resources < 0.13.7","invenio-app-rdm < 6.0.5","invenio-rdm-records < 0.32.6","invenio-drafts-resources >= 0.14.0, < 0.14.6","invenio-rdm-records >= 0.33.0, < 0.33.10","invenio-app-rdm >= 7.0.0.dev0, < 7.0.0.dev5"],"patched":["invenio-drafts-resources 0.13.7","invenio-app-rdm 6.0.5","invenio-rdm-records 0.32.6","invenio-drafts-resources 0.14.6","invenio-rdm-records 0.33.10","invenio-app-rdm 7.0.0.dev5"],"published":"2021-12-06","updated":"2026-07-08","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-xr38-w74q-r8jv","references":[{"url":"https://github.com/inveniosoftware/invenio-drafts-resources/security/advisories/GHSA-xr38-w74q-r8jv"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-43781"},{"url":"https://github.com/inveniosoftware/invenio-drafts-resources/commit/039b0cff1ad4b952000f4d8c3a93f347108b6626"},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/invenio-app-rdm/PYSEC-2021-837.yaml"},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/invenio-drafts-resources/PYSEC-2021-836.yaml"}],"tags":["osv","pip"],"epss":0.00662,"epssPercentile":0.5029,"ingestedAt":"2026-07-08T18:25:54.661Z","slug":"CVE-2021-43781","body":"## Overview\n\n### Impact\n\nInvenio-Drafts-Resources does not properly check permissions when a record is published. The vulnerability is exploitable in a default installation of InvenioRDM. An authenticated 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.\n\n### Details\n\nThe service's ``publish()`` method contains the following permission check:\n\n```python\ndef publish(..):\n    self.require_permission(identity, \"publish\")\n```\nHowever, the record should have been passed into the permission check so that the need generators have access to e.g. the record owner.\n\n```python\ndef publish(..):\n    self.require_permission(identity, \"publish\", record=record)\n```\nThe bug is activated in Invenio-RDM-Records which has a need generator called ``RecordOwners()``, which when no record is passed in defaults to allow any authenticated user:\n\n```python\nclass RecordOwners(Generator):\n    def needs(self, record=None, **kwargs):\n        if record is None:\n            return [authenticated_user]\n    # ...\n```\n\n### Patches\n\nThe 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.\n\nYou can verify the version installed of Invenio-Drafts-Resources via PIP:\n\n```console\ncd ~/src/my-site\npipenv run pip freeze | grep invenio-drafts-resources\n```\n\n### References\n\n- [Security policy](https://invenio.readthedocs.io/en/latest/community/security-policy.html)\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Chat with us on Discord: https://discord.gg/8qatqBC\n\n\n\n## Affected packages\n\n- `invenio-drafts-resources < 0.13.7`\n- `invenio-app-rdm < 6.0.5`\n- `invenio-rdm-records < 0.32.6`\n- `invenio-drafts-resources >= 0.14.0, < 0.14.6`\n- `invenio-rdm-records >= 0.33.0, < 0.33.10`\n- `invenio-app-rdm >= 7.0.0.dev0, < 7.0.0.dev5`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `invenio-drafts-resources 0.13.7`\n- `invenio-app-rdm 6.0.5`\n- `invenio-rdm-records 0.32.6`\n- `invenio-drafts-resources 0.14.6`\n- `invenio-rdm-records 0.33.10`\n- `invenio-app-rdm 7.0.0.dev5`","depth":"sunlit","depthScore":35,"depthScoreParts":{"impact":35.2,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}