Summary
Serendipity contains a server-side request forgery vulnerability in the
serendipity_url_allowed() filter. An authenticated user with the
adminImagesAdd permission may use alternate IP address representations to
bypass filtering, request internal services, and retrieve response bodies
through the public uploads directory.
Affected context
The issue occurs in Serendipity deployments where the URL allowlisting filter
processes user-controlled image or upload-related URLs. Risk is increased when
authenticated users have the adminImagesAdd permission and the server can
reach internal networks, IPv6 endpoints, or link-local services. The affected
validation logic may not recognize hexadecimal IPv4 representations, IPv6
literals, or link-local address ranges as internal destinations.
Exploit preconditions
- Attack surface: The image or upload URL handling functionality protected
by the adminImagesAdd permission
- Required access: An authenticated account with
adminImagesAdd - Trigger point: Processing a user-supplied URL through the
serendipity_url_allowed() filter
- Why exploitation is possible: Address validation does not consistently
canonicalize or reject alternate representations of internal IPv4, IPv6,
and link-local destinations
- Disclosure path: Retrieved response content may become accessible through
the public uploads directory
Why this happens
The vulnerability is caused by incomplete server-side URL validation and
address canonicalization. The filtering logic checks destination formats
without reliably normalizing hexadecimal IPv4 addresses, IPv6 literals, and
link-local ranges before applying network-boundary rules. This allows a
user-controlled URL to resolve to an internal destination that the filter
intended to block, mapping to CWE-918: Server-Side Request Forgery.
Potential impact
- An attacker may access services on internal network interfaces.
- Sensitive response bodies could be retrieved through a publicly reachable
uploads path.
- Cloud or infrastructure metadata may be exposed where reachable.
- Internal administrative APIs may be probed or accessed.
- The server could be used as a pivot toward other systems.
General mitigation guidance
Mitigation generally focuses on enforcing destination validation after full
URL and address normalization.
Common defensive patterns include:
- Canonicalizing hostnames and IP addresses before applying allowlists or
denylists.
- Rejecting private, loopback, link-local, multicast, unspecified, and
other non-public address ranges across IPv4 and IPv6.
- Resolving hostnames and validating every resulting address, including
protections against DNS rebinding.
- Using an explicit outbound destination allowlist rather than relying only
on blocklists.
- Preventing fetched response bodies from being written to publicly
accessible locations unless strictly required.
- Restricting outbound network access and running the web process with
minimal privileges.
How teams detect issues like this
Detection approaches can include:
- Static analysis and code review rules for URL fetches that lack
canonicalization and post-resolution network checks.
- Review signals such as direct string comparisons against IP addresses,
incomplete IPv4-only validation, and unrestricted redirects.
- Dynamic tests covering hexadecimal IPv4 notation, IPv6 literals,
link-local targets, redirects, DNS rebinding, and encoded host forms.
- Network monitoring for unexpected web-server requests to private,
loopback, metadata, or link-local address ranges.
- Policy enforcement that restricts outbound connections from application
workloads and prevents sensitive fetched content from entering public
asset directories.

