/

CVE-2026-29925

Severity:

HIGH RISK

(7.7)

SSRF in Invoice Ninja CheckDatabaseRequest

CVE-2026-29925

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Network Pivoting and Internal Service Exposure via SSRF

Severity:

HIGH RISK

(7.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Invoice Ninja v5.12.46 and v5.12.48 contain a Server-Side Request Forgery (SSRF) issue in CheckDatabaseRequest.php, allowing crafted inputs to trigger outbound HTTP requests from the server.

When an attacker can influence database check or connectivity URLs, they may cause the application server to connect to arbitrary internal or external endpoints, exposing internal services or metadata.

Affected context

This vulnerability appears in the database connectivity or validation logic implemented in CheckDatabaseRequest.php within Invoice Ninja.

It is relevant where:

  • The application performs server-side checks to validate database hosts or related endpoints.
  • User-controlled or tenant-controlled data can influence the target of these checks.
  • Outbound network egress from the application server is allowed, including to internal addresses or metadata services.

The issue is most impactful in deployments where the Invoice Ninja server has network visibility into internal infrastructure not intended to be exposed to end users.

Exploit preconditions

  • Attack surface: HTTP(S) interface where database configuration or connectivity checks are initiated (e.g., setup, configuration, or admin flows).
  • Required access: Ability to submit or modify parameters used by CheckDatabaseRequest.php (such as host, URL, or connection string fields). This may require authenticated access depending on deployment.
  • Trigger point: Invocation of the database check routine, which initiates an outbound request using attacker-influenced input.
  • Why exploitation is possible: The server-side code treats untrusted input as a network target and issues backend requests without sufficient validation or restriction of destination hosts, protocols, or IP ranges, matching the SSRF pattern described in CWE-918.

Why this happens

The underlying flaw is the lack of strict validation and sanitization around how destination hosts or endpoints are derived for server-side connectivity checks in CheckDatabaseRequest.php.

User-supplied or otherwise untrusted parameters are used to construct outbound network requests, and the server executes those requests with its own network privileges.

This reflects CWE-918: Server-Side Request Forgery, where an attacker leverages server-initiated HTTP requests to interact with arbitrary internal or external resources.

In abstract terms, the bug class is: "Application logic that converts untrusted configuration-like input directly into network destinations, without applying allow-listing, DNS/IP filtering, or scheme restrictions."

Potential impact

  • Access to internal services that are not directly exposed to the internet (e.g., databases, message queues, admin panels).
  • Interaction with cloud metadata endpoints, which may disclose credentials, tokens, or configuration.
  • Port scanning or network reconnaissance of internal addresses from the server's perspective.
  • Potential data exfiltration from internal endpoints that respond with sensitive information.
  • Abuse of the server as a proxy to reach external targets, possibly bypassing IP-based access controls.

General mitigation guidance

Effective mitigation focuses on reducing trust in user-controlled network destinations and constraining server-initiated requests:

  • Introduce strict allow-lists for hosts or networks that database connectivity checks are permitted to contact (e.g., known DB hosts or internal ranges only).
  • Enforce validation on protocol and port, disallowing non-expected schemes (such as HTTP) when only database protocols are intended.
  • Implement IP and DNS resolution filtering to block requests to loopback, link-local, private network ranges, and cloud metadata endpoints unless explicitly required.
  • Decouple user input from direct network calls by mapping user-selectable options to predefined, server-side configuration rather than free-form hostnames or URLs.
  • Run the application with least-privilege network exposure, limiting outbound connectivity where possible via firewall rules or network policies.

How teams detect issues like this

Detection approaches generally combine code-centric analysis with runtime monitoring:

  • Static analysis / code review:
  • Search for HTTP clients or low-level socket usage in CheckDatabaseRequest.php and related classes where destination URLs/hosts derive from request data or configuration fields.
  • Flag patterns where user-controlled fields (e.g., "host", "url", "server") are passed into network client constructors without validation or allow-list enforcement.
  • Review database connectivity helpers for any generic URL parsing that supports unexpected schemes or ports.
  • Policy enforcement:
  • Implement secure coding guidelines that prohibit direct network calls to unvalidated user-provided addresses.
  • Use automated SAST or custom linters to identify potential SSRF sinks (HTTP clients, database drivers) fed by request parameters.
  • Operational monitoring:
  • Monitor outbound connections from the Invoice Ninja host for anomalous destinations, such as link-local IPs, 169.254.0.0/16, 127.0.0.0/8, or unusual external hosts triggered by user actions.

Sources

SourceLink
gist.github.comgist.github.com/TrekLaps/5b2c72106d950dab0cd1897eb93200f1
github.comgithub.com/invoiceninja/invoiceninja/blob/v5-stable/app/Http/Requests/Setup/CheckDatabaseRequest.php

Frequently asked

questions

Yes, if an attacker can reach the endpoint that triggers CheckDatabaseRequest.php and control the relevant parameters, they can potentially cause the server to perform SSRF attempts. Whether this is internet-exposed or limited to authenticated or internal users depends on the specific deployment and configuration.

Typically, the attacker needs the ability to submit or alter database connection or check parameters through the Invoice Ninja interface or API. In many setups this may require authenticated access (e.g., an admin or tenant-level user), but misconfigurations or exposed setup flows can lower this bar.

The safest approach is to ensure the database check logic does not accept arbitrary network destinations. Replace free-form host or URL inputs with a controlled mapping to known, trusted database endpoints, and enforce strict allow-lists and protocol restrictions before any outbound request is made.

Adopt a design principle that untrusted input must never directly determine network targets. Enforce allow-lists, validate schemes, ports, and resolved IP ranges, restrict outbound network access at the infrastructure level, and integrate automated checks (code review, SAST, security tests) focused on SSRF patterns into the development lifecycle.

Find out what's already
exploitable in your codebase.