/

CVE-2026-72550

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in Friendica Photo View Order

CVE-2026-72550

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized Database Access and Modification

Severity:

CRITICAL RISK

(9.8)

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

A critical SQL injection vulnerability in Friendica allows unauthenticated remote attackers to inject arbitrary SQL statements through the photo-view order parameter. Because the parameter is concatenated into a database query without adequate escaping, attackers may read, modify, or delete application data.

Affected context

The vulnerability occurs in Friendica's photo-view functionality when the order parameter is incorporated into a SHOW COLUMNS query through a direct database query API. Deployments are at risk when this endpoint is publicly reachable and request parameters can reach the query without strict validation or parameterization.

Exploit preconditions

  • Attack surface: Publicly accessible photo-view functionality
  • Required access: No authentication may be required
  • Trigger point: Processing of the photo-view order parameter
  • Why exploitation is possible: User-controlled input is concatenated into a SQL statement and executed through a database query interface that permits stacked statements

Why this happens

The underlying defect is the construction of SQL statements by concatenating untrusted request data into a query string. This insecure pattern allows input to alter query structure and, where the database interface permits multiple statements, extend execution beyond the intended operation. The issue maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Potential impact

  • Attackers may read sensitive database records
  • Attackers could modify application, user, or configuration data
  • Attackers may delete database contents
  • The application could suffer data integrity loss or service disruption
  • Compromised data could support further account or infrastructure attacks

General mitigation guidance

Mitigation generally focuses on ensuring that untrusted values cannot influence SQL syntax.

Common defensive patterns include:

  • Using parameterized queries or prepared statements for all variable values
  • Applying strict allowlist validation for order fields and directions
  • Avoiding database APIs that permit unintended stacked statement execution
  • Restricting database credentials to the minimum required operations
  • Separating application and administrative database privileges
  • Treating client-supplied sorting and filtering values as untrusted by default

These controls should be combined with consistent query-construction standards and centralized database access helpers.

How teams detect issues like this

Organizations can look for:

  • Static analysis findings involving string concatenation or interpolation in SQL calls
  • Code review signals where request parameters flow directly into query-building logic
  • Database API usage that executes dynamically assembled statements
  • Runtime monitoring for unusual query syntax, stacked statements, or unexpected schema access
  • Web application firewall and database audit policies covering injection indicators

Automated code review and security scanning tools can help identify unsafe data flows, but findings should be validated against actual query construction and database behavior.

Sources

SourceLink
github.comgithub.com/friendica/friendica

Frequently asked

questions

Yes. The described attack surface is a remotely reachable photo-view endpoint, and exploitation may not require authentication.

An attacker generally needs only network access to the affected Friendica functionality and the ability to submit a crafted order parameter.

Use parameterized queries for values and strict allowlists for identifiers such as sortable column names. Do not build SQL syntax directly from request data.

Apply centralized database access practices, enforce least-privilege database accounts, review user-input data flows, and use static analysis and runtime database monitoring to detect unsafe query construction.

Find out what's already
exploitable in your codebase.