Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacyΒ© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-42167 β€” Technical analysis and proof-of-concept for CVE-2026-42167, a critical SQL injection in ProFTPD mod_sql enabling authentication bypass, backdoor user injection, and remote code execution. | Kitploit
Tools/GitHubGitHub/kaleth4/cve-2026-42167
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationRed Teaming
GitHubkaleth4/cve-2026-42167

CVE-2026-42167

Technical analysis and proof-of-concept for CVE-2026-42167, a critical SQL injection in ProFTPD mod_sql enabling authentication bypass, backdoor user injection, and remote code execution.

View Repository
215 months agoNot yet reviewed

Most Popular

View all β†’

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools β†’
Share

CVE-2026-42167: SQL Injection in ProFTPD mod_sql

πŸ“‹ Executive Summary

CVE-2026-42167 is a critical SQL injection vulnerability in ProFTPD's mod_sql module that allows authentication bypass, backdoor user injection, and remote code execution (RCE).

AttributeValue
TypeSQL Injection (CWE-89)
SeverityHigh/Critical
CVSS v38.1
Componentmod_sql in ProFTPD < 1.3.9a
Reported byZeroPath Research
DateApril 28, 2026

πŸ” Technical Description

The Problem: Weak Validation in is_escaped_text()

ProFTPD uses the is_escaped_text() function to determine whether a value has already been sanitized before inserting it into an SQL query. The function assumes that any input that:

  • Starts with a single quote '
  • Ends with a single quote '
  • Contains no internal single quotes

...has already been escaped and requires no further processing.

The Exploit

An attacker can send a malicious username such as:

USER ' || (SELECT 1) ||'

When inserted into an SQL query such as:

INSERT "'%U', '%r', '%m'" activity_log

The result is:

INSERT "'' || (SELECT 1) || ''" activity_log

The payload executes as arbitrary SQL because the || operators concatenate empty strings around the injected command.


⚠️ Impact Scenarios

1️⃣ Remote Code Execution (RCE)

Requirements:

  • PostgreSQL backend
  • Database user with superuser privileges
  • SQL logging enabled with %U or %{basename} variables

Technique:

COPY (SELECT 1) TO PROGRAM 'malicious_command'

Executes operating system-level commands as the postgres user.

2️⃣ Authentication Bypass

Requirements:

  • SQLAuthenticate enabled
  • SQL logging with %U variable in SQLLog ERR_* (pre-authentication)

Technique:

INSERT INTO users (username, password, uid, homedir) 
VALUES ('attacker', 'password_hash', 0, '/')

The attacker injects a backdoor user with uid=0 (root) and access to the entire filesystem.

3️⃣ Data Exfiltration

Requirements:

  • Any SQL backend
  • SQL logging enabled

Technique: Time-based blind SQL injection to extract credentials character by character.


πŸ“Š Attack Vectors

Attacker-Controlled Variables

VariableMeaningScope
%UOriginal username (before authentication)Pre-auth
%AAnonymous login passwordPre-auth
%JCommand parametersPre-auth
%mFTP verb (STOR, RETR, etc.)Pre-auth
%{basename}Filename componentPost-auth
%lident response (RFC 1413)Pre-auth (if identd is available)

Exploitation Paths

Pre-authentication (most critical):

%U + SQLLog ERR_* β†’ No credentials required

Post-authentication:

%{basename} + SQLLog STOR β†’ Requires any valid FTP user

πŸ›‘οΈ Mitigation and Remediation

βœ… Recommended Fix

Update immediately to ProFTPD 1.3.9a or later:

# Check current version
proftpd -v

# Update (example for Debian/Ubuntu)
sudo apt-get update
sudo apt-get install proftpd-basic=1.3.9a-1

πŸ”§ Temporary Mitigations

If you cannot update immediately:

  1. Disable SQL logging:
# Comment out or remove these lines in proftpd.conf
# SQLLog * log_activity
# SQLLog ERR_* log_activity
  1. Apply the principle of least privilege:
-- In PostgreSQL, create a user without superuser privileges
CREATE USER proftpd_user WITH PASSWORD 'secure_password';
GRANT SELECT, INSERT ON activity_log TO proftpd_user;
-- DO NOT grant SUPERUSER
  1. Monitor for exploit attempts:
TraceLog /var/log/proftpd/trace.log
Trace sql:17

πŸ”Ž Vulnerability Verification

Indicator of Compromise

Search ProFTPD trace logs (with Trace sql:17 enabled):

text 'payload' is already escaped, skipping escaping it again

This message indicates that a bypass attempt has been processed by the vulnerable engine.

Verification Command

# Enable detailed traces
echo "Trace sql:17" >> /etc/proftpd/proftpd.conf

# Restart ProFTPD
sudo systemctl restart proftpd

# Monitor logs
tail -f /var/log/proftpd/trace.log | grep "already escaped"

πŸ“¦ Version Information

VersionStatus
< 1.3.9❌ Vulnerable
1.3.9❌ Vulnerable
β‰₯ 1.3.9aβœ… Patched
β‰₯ 1.3.10rc1βœ… Patched

πŸ§ͺ Proof of Concept (PoC)

Official Repository

GitHub: ZeroPathAI/proftpd-CVE-2026-42167-poc

Quick Setup with Docker

# Clone repository
git clone https://github.com/ZeroPathAI/proftpd-CVE-2026-42167-poc.git
cd proftpd-CVE-2026-42167-poc

# Requirements
# - Docker
# - Git
# - Python 3.10+
# - uv (Python package manager)

# Set up vulnerable environment
cd setup
./setup.sh

# Run PoCs
cd ../pocs
python3 preauth_user_backdoor.py      # Inject backdoor user (pre-auth)
python3 preauth_user_rce.py           # RCE via COPY TO PROGRAM (pre-auth)
python3 postauth_stor_backdoor.py     # Inject user (post-auth)
python3 postauth_stor_rce.py          # RCE (post-auth)

# Clean up
cd ../setup
./teardown.sh

πŸ“… Timeline

DateEvent
2026-03-28Vulnerability reported to ProFTPD
2026-04-07Verification and patch development
2026-04-24CVE-2026-42167 assigned
2026-04-27Patch released (commit af90843baf7dcb8c6be1e5261be2d0b5b5850673)
2026-04-27ProFTPD 1.3.9a released

πŸ“š References

  • NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-42167
  • Technical Blog: https://zeropath.com/blog/proftpd-cve-2026-42167-auth-bypass-privesc-rce
  • PoC Repository: https://github.com/ZeroPathAI/proftpd-CVE-2026-42167-poc
  • Release Notes: http://www.proftpd.org/docs/RELEASE_NOTES-1.3.10rc1
  • Discussion: https://github.com/proftpd/proftpd/issues/2052

⚑ Final Recommendations

  1. Immediate Action: Update ProFTPD to 1.3.9a or later
  2. Audit: Review SQLLog configurations on all ProFTPD servers
  3. Privileges: Ensure database users do not have superuser permissions
  4. Monitoring: Implement alerts for SQL injection attempts
  5. Patches: Maintain a regular patching program for all dependencies

Last updated: April 28, 2026
Source: ZeroPath Research, MITRE CVE, NVD

Download Tool