CVE-2026-9059 NextGEN Gallery - SQL Injection

Critical 9.3 Published Updated

Authenticated attackers with specific capabilities can inject SQL via the orderby parameter in NextGEN Gallery REST API endpoints.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2026-9059?

CVE-2026-9059 is a critical SQL injection vulnerability in awesomemotive NextGEN Gallery, published on 20 May 2026. An attacker needs administrator access to exploit it, with no action from the victim.

Official description

NextGEN Gallery version prior to 4.2.1 are vulnerable to authenticated SQL injection via the 'orderby' parameter on the REST API endpoints '/imagely/v1/galleries' and '/imagely/v1/albums'.

The root cause is an insufficient sanitization function ('_clean_column()') in the data mapper layer that uses a character blacklist instead of a whitelist approach. This allows an authenticated attacker with the 'NextGEN Gallery overview' capability (assigned to the Administrator role by default) to inject arbitrary SQL into the 'ORDER BY' clause.

Weakness: CWE-89

Which versions are affected by CVE-2026-9059?

How do I fix CVE-2026-9059?

No fix has been published for CVE-2026-9059 yet. Limit exposure of the affected software until one is available.

Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.

Is CVE-2026-9059 being exploited?

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

Sources

Also known as GHSA-q977-85xc-w698.

Is CVE-2026-9059 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free