# GHSA-595p-g7xc-c333: Algolia Search & Discovery for Magento 2 Has Untrusted Data Handling

> Attackers with database write access can execute arbitrary PHP code via the Algolia indexing queue in Magento 2.

- **Severity:** Not scored
- **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:** 14 Jan 2026

## What is GHSA-595p-g7xc-c333?

GHSA-595p-g7xc-c333 is a code injection vulnerability in algolia/algoliasearch-magento-2, published on 14 Jan 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### Impact

Versions of the Algolia Search & Discovery extension for Magento 2 prior to **3.17.2** and **3.16.2** contain a vulnerability where data read from the database was treated as a trusted source during job execution.

If an attacker is able to modify records used by the extension’s indexing queue, this could result in **arbitrary PHP code execution** when the affected job is processed.

Exploitation requires the ability to write malicious data to the Magento database and for the indexing queue to be enabled.

---

### Patches

This vulnerability has been fixed in the following versions:

- **3.17.2**
- **3.16.2**

Merchants should upgrade to a supported patched version immediately.

Versions outside the supported maintenance window do **not** receive security updates and remain vulnerable.

---

### Workarounds

Upgrading to a patched version is the only recommended remediation.

If an immediate upgrade is not possible, the following temporary risk mitigations may reduce exposure:

- Disable the Algolia indexing queue to prevent queued jobs from being executed.
- Restrict job execution logic to an explicit allowlist of permitted operations.
- Review the contents of the `algoliasearch_queue` table for unexpected or unrecognized entries.
- If queue archiving is enabled, review historical records in `algoliasearch_queue_archive`.

These mitigations are provided as guidance only and do not replace upgrading to a patched version.

---

### References

- Algolia Search & Discovery for Magento 2 releases:
  - [3.16.2](https://github.com/algolia/algoliasearch-magento-2/releases/tag/3.16.2)
  - [3.17.2](https://github.com/algolia/algoliasearch-magento-2/releases/tag/3.17.2)

## Which versions are affected by GHSA-595p-g7xc-c333?

4 open source packages ship an affected version, including algolia/algoliasearch-magento-2.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `algolia/algoliasearch-magento-2` | Packagist | All versions | 3.16.2 |
| `algolia/algoliasearch-magento-2` | Packagist | All versions | 3.16.2 |
| `algolia/algoliasearch-magento-2` | Packagist | From 3.17.0-beta.1 | 3.17.2 |
| `algolia/algoliasearch-magento-2` | Packagist | From 3.17.0-beta.1 | 3.17.2 |

## How do I fix GHSA-595p-g7xc-c333?

Upgrade algolia/algoliasearch-magento-2 to a fixed version for your release line: 3.16.2 or 3.17.2.

## Is GHSA-595p-g7xc-c333 being exploited?

There is no known exploitation of GHSA-595p-g7xc-c333 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-595p-g7xc-c333 and fix it if it is affected.

What it is: GHSA-595p-g7xc-c333 is a code injection vulnerability in algolia/algoliasearch-magento-2, published on 14 Jan 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-595p-g7xc-c333 in the wild and no public exploit code.

Affected packages and fixed versions:
- algolia/algoliasearch-magento-2 (Packagist): affected all versions; fixed in 3.16.2
- algolia/algoliasearch-magento-2 (Packagist): affected all versions; fixed in 3.16.2
- algolia/algoliasearch-magento-2 (Packagist): affected from 3.17.0-beta.1; fixed in 3.17.2
- algolia/algoliasearch-magento-2 (Packagist): affected from 3.17.0-beta.1; fixed in 3.17.2

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-595p-g7xc-c333/ (Markdown: https://insights.sbomify.com/GHSA-595p-g7xc-c333/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-595p-g7xc-c333

---
From sbomify Insights: https://insights.sbomify.com/GHSA-595p-g7xc-c333/
Summaries are generated and may contain mistakes; the official description above is the record.
