# GHSA-wqq8-mqj9-697f: PrestaShop autoupgrade module ZIP archives were vulnerable from CVE-2017-9841

> Attackers can execute arbitrary code on PrestaShop servers via vulnerable PHPUnit scripts included in autoupgrade module archives.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 8 Jan 2020

## What is GHSA-wqq8-mqj9-697f?

GHSA-wqq8-mqj9-697f is a code injection vulnerability in prestashop/autoupgrade, published on 8 Jan 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact

We have identified that some autoupgrade module ZIP archives have been built with phpunit dev dependencies. PHPUnit contains a php script that would allow, on a webserver, an attacker to perform a RCE.

This vulnerability impacts
- phpunit before 4.8.28 and 5.x before 5.6.3 as reported in [CVE-2017-9841](https://nvd.nist.gov/vuln/detail/CVE-2017-9841)
- phpunit >= 5.63 before 7.5.19 and 8.5.1 (this is a newly found vulnerability that is currently being submitted as a CVE after disclosure was provided to phpunit maintainers)

You can read PrestaShop official statement about this vulnerability [here](https://build.prestashop.com/news/critical-security-vulnerability-in-prestashop-modules/).

### Patches

In the [security patch](https://github.com/PrestaShop/autoupgrade/releases/tag/v4.10.1), we look for the unwanted vendor/phpunit folder and remove it if we find it. This allows users to fix the security issue when upgrading.

### Workarounds
Users can also simply remove the unwanted vendor/phpunit folder.

### References
https://nvd.nist.gov/vuln/detail/CVE-2017-9841

### For more information
If you have any questions or comments about this advisory, email us at security@prestashop.com

## Which versions are affected by GHSA-wqq8-mqj9-697f?

2 open source packages ship an affected version, including prestashop/autoupgrade.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `prestashop/autoupgrade` | Packagist | From 4.0.0 | 4.10.1 |
| `prestashop/autoupgrade` | Packagist | From 4.0.0 | 4.10.1 |

## How do I fix GHSA-wqq8-mqj9-697f?

Upgrade prestashop/autoupgrade to 4.10.1 or later.

## Is GHSA-wqq8-mqj9-697f being exploited?

There is no known exploitation of GHSA-wqq8-mqj9-697f in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-wqq8-mqj9-697f and fix it if it is affected.

What it is: GHSA-wqq8-mqj9-697f is a code injection vulnerability in prestashop/autoupgrade, published on 8 Jan 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-wqq8-mqj9-697f in the wild and no public exploit code.

Affected packages and fixed versions:
- prestashop/autoupgrade (Packagist): affected from 4.0.0; fixed in 4.10.1
- prestashop/autoupgrade (Packagist): affected from 4.0.0; fixed in 4.10.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/GHSA-wqq8-mqj9-697f/ (Markdown: https://insights.sbomify.com/GHSA-wqq8-mqj9-697f/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-wqq8-mqj9-697f

---
From sbomify Insights: https://insights.sbomify.com/GHSA-wqq8-mqj9-697f/
Summaries are generated and may contain mistakes; the official description above is the record.
