# CVE-2015-1326: python-dbusmock arbitrary code execution or file overwrite when templates are loaded from /tmp

> Attackers can execute arbitrary code or overwrite files by supplying malicious .pyc templates to python-dbusmock methods.

- **Severity:** Medium 5.7 (`CVSS:3.0/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 22 Apr 2019
- **Updated:** 16 Sep 2024
- **Also known as:** DEBIAN-CVE-2015-1326, GHSA-74xw-82v7-hmrm, PYSEC-2019-155, UBUNTU-CVE-2015-1326, USN-2618-1

## What is CVE-2015-1326?

CVE-2015-1326 is a medium-severity code injection vulnerability in Ubuntu python-dbusmock, published on 22 Apr 2019. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

python-dbusmock before version 0.15.1 AddTemplate() D-Bus method call or DBusTestCase.spawn_server_template() method could be tricked into executing malicious code if an attacker supplies a .pyc file.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2015-1326?

3 open source packages ship an affected version, including python-dbusmock. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `python-dbusmock` | PyPI | All versions | 0.15.1 |
| `python-dbusmock` | PyPI | All versions | 0.15.1 |
| `python-dbusmock` | PyPI | All versions | 0.15.1 |

Products: Python-Dbusmock Project Python-Dbusmock.

## How do I fix CVE-2015-1326?

Upgrade python-dbusmock to 0.15.1 or later.

## Is CVE-2015-1326 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2015-1326 and fix it if it is affected.

What it is: CVE-2015-1326 is a medium-severity code injection vulnerability in Ubuntu python-dbusmock, published on 22 Apr 2019. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2015-1326 in the wild and no public exploit code.

Affected packages and fixed versions:
- python-dbusmock (PyPI): affected all versions; fixed in 0.15.1
- python-dbusmock (PyPI): affected all versions; fixed in 0.15.1
- python-dbusmock (PyPI): affected all versions; fixed in 0.15.1

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-2015-1326/ (Markdown: https://insights.sbomify.com/CVE-2015-1326/index.md)
```

## Sources

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

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