Summary
Wallos, a self-hostable subscription tracker, contains a server-side request forgery (SSRF) issue where webhook URL validation relies on gethostbyname() but sends the original hostname to cURL without pinning the resolved IP.
This mismatch leaves a DNS rebinding time-of-check/time-of-use (TOCTOU) window that can allow attackers to direct Wallos to make unintended HTTP requests to internal or otherwise restricted network targets.
Affected context
The vulnerability occurs in Wallos deployments that make outbound HTTP requests to user-controlled or semi-trusted webhook URLs.
The application performs a DNS resolution check with gethostbyname() but then uses cURL to connect using the original hostname on most webhook-capable endpoints, without IP pinning.
In environments where DNS responses can be manipulated over time (e.g., attacker-controlled domains, permissive DNS infrastructure, misconfigured resolvers), this can enable DNS rebinding that bypasses the initial validation and targets internal services.
Exploit preconditions
- Attack surface: Outbound HTTP requests initiated by Wallos toward configured webhook or callback URLs.
- Required access: Ability to configure or influence webhook URLs (e.g., through application features that allow adding or editing webhooks, or any user input that results in HTTP callbacks).
- Trigger point: Execution of one of the affected HTTP endpoints where Wallos performs DNS validation once, then issues the actual cURL request at a later time using the hostname.
- Why exploitation is possible: The validation uses
gethostbyname()to obtain and inspect an IP at time-of-check, but the actual HTTP request is made withoutCURLOPT_RESOLVEor equivalent IP pinning. This creates a TOCTOU gap in which DNS records can be changed (DNS rebinding) so that subsequent resolutions by cURL or the OS resolver point to different, potentially internal, addresses, allowing SSRF.
Why this happens
The underlying bug is an incomplete SSRF mitigation that separates hostname validation from the actual connection target without binding them together.
Wallos attempts to validate webhook URLs by resolving the hostname with gethostbyname() and presumably checking the resulting IP address against some policy (e.g., blocking private ranges).
However, when making the outbound HTTP call, it passes the original hostname to cURL and does not force cURL to use the previously validated IP via CURLOPT_RESOLVE or a similar mechanism.
This disconnect between validation and use maps to CWE-918: Server-Side Request Forgery (SSRF), aggravated by a time-of-check/time-of-use flaw in DNS handling: the application trusts that the DNS answer at validation time will remain valid at use time, which is not guaranteed in adversarial conditions.
Potential impact
- Wallos may be coerced into making HTTP requests to internal services that are not directly exposed to the internet.
- Attackers could possibly interact with cloud metadata services or other sensitive endpoints accessible from the Wallos host or network.
- Internal network scanning may be facilitated by observing differences in responses from rebinding to various internal IPs.
- Sensitive information reachable via HTTP on internal systems could potentially be exfiltrated through SSRF responses.
- Depending on the environment, SSRF could be chained with other issues (e.g., misconfigured admin endpoints, internal APIs) to escalate privileges or pivot deeper into the infrastructure.
General mitigation guidance
Effective mitigation focuses on binding hostname validation to the actual connection and reducing trust in user-supplied URLs.
Recommended defensive patterns include:
- IP pinning after validation: After resolving and validating the hostname, use APIs that force the HTTP client to connect to the vetted IP address (e.g., cURL's
CURLOPT_RESOLVE), rather than re-resolving the hostname at request time. - Strict address filtering: Implement allow/deny logic on the final destination IP, blocking private, link-local, loopback, and other sensitive ranges regardless of DNS hostname.
- Limit user-controlled callbacks: Restrict webhook functionality to a curated set of trusted domains or use an explicit allowlist instead of arbitrary user-supplied URLs where possible.
- Network-level egress controls: Use firewall or proxy rules to prevent application hosts from reaching internal-only services or sensitive infrastructure from general-purpose HTTP clients.
- Fail-safe design: When validation fails or is inconclusive, default to denying the request instead of attempting a best-effort connection.
How teams detect issues like this
Organizations can pursue several approaches to detect this class of issue and its exploitation:
- Static analysis and code review:
- Look for flows where user-supplied URLs are used in outbound HTTP requests.
- Flag patterns where DNS checks (e.g.,
gethostbyname()) are performed separately from the HTTP client without explicit IP pinning. - Review webhook and callback implementations for proper filtering of private or special-use IP address ranges.
- Dynamic analysis and testing:
- Use security testing tools or custom scripts to perform DNS rebinding tests against webhook endpoints, verifying whether the application continues to trust hostnames without binding to a validated IP.
- Monitor HTTP client logs to identify outbound connections to unexpected internal or special IP ranges.
- Operational monitoring:
- Collect and analyze egress traffic from the Wallos host for connections to RFC1918, loopback, link-local, and metadata service addresses.
- Implement alerting on unusual patterns of outbound requests originating from webhook or callback features.
- Automated policy enforcement:
- Integrate security scanners into CI/CD pipelines that flag unpinned DNS validation or permissive webhook implementations.
- Enforce code-level policies or linting rules requiring centralized HTTP client wrappers with SSRF protections.

