Executive Summary
CVE-2026-78143 is a high-severity SQL injection vulnerability affecting code-projects Barangay Resident Profiling Management System 1.0. The flaw resides in the residents.php file within the Resident Search Functionality component, where unsanitized user input in the Search argument is passed directly to SQL queries. Remote exploitation is possible, and the attack vector is publicly accessible.
CVSS Score: 7.3 (High)
Vulnerability Overview
Root Cause
The vulnerability stems from insufficient input validation in the resident search handler. The Search parameter submitted via the search form is interpolated directly into SQL query strings without parameterization or escaping, enabling classic SQL injection attacks.
Attack Chain
1. Attacker identifies a deployment of Barangay Resident Profiling System 1.0
2. Navigates to residents.php and submits a crafted Search payload
3. Malicious SQL is injected into the backend query
4. Database responds with unauthorized data (dump, authentication bypass, etc.)
5. Attacker extracts resident PII or escalates accessTechnical Details
Affected Component
| Component | File | Parameter |
|---|---|---|
| Resident Search | residents.php | Search |
Vulnerability Type
CWE-89 — Improper Neutralization of Special Elements used in an SQL Command (SQL Injection)
SQL injection via GET or POST parameter allows an unauthenticated attacker to:
- Extract data from the underlying database (resident names, addresses, IDs, contact info)
- Potentially enumerate database structure
- In misconfigured deployments, achieve file read/write via
LOAD_FILE/INTO OUTFILE
Affected Systems
| System | Version | Status |
|---|---|---|
| Barangay Resident Profiling Management System | 1.0 | Vulnerable — no patch available |
This project is a PHP/MySQL government-records web application primarily deployed by barangay (village-level local government) offices in the Philippines to manage resident profiles, household data, and census information.
Remediation
Immediate Mitigations
As no vendor patch has been issued at the time of this advisory, administrators should apply the following mitigations immediately:
1. Parameterized Queries (Code Fix)
Replace any direct interpolation of the Search parameter with PDO or MySQLi prepared statements:
// Vulnerable (DO NOT USE)
$query = "SELECT * FROM residents WHERE name LIKE '%" . $_GET['Search'] . "%'";
// Secure — use prepared statements
$stmt = $pdo->prepare("SELECT * FROM residents WHERE name LIKE ?");
$stmt->execute(['%' . $_GET['Search'] . '%']);
$results = $stmt->fetchAll();2. Web Application Firewall
Deploy WAF rules to block common SQL injection patterns targeting residents.php:
SecRule ARGS:Search "@detectSQLi" \
"id:10002026,phase:2,deny,status:403,msg:'SQL Injection Blocked — residents.php'"
3. Restrict Network Access
If the application is only used internally, restrict residents.php to trusted IP ranges via .htaccess or server firewall rules:
<Files "residents.php">
Order Deny,Allow
Deny from all
Allow from 192.168.1.0/24
</Files>4. Input Validation
Apply server-side allowlisting on the Search parameter — resident names should only contain alphanumeric characters, spaces, and common punctuation:
$search = preg_replace('/[^a-zA-Z0-9\s\-\.\,]/', '', $_GET['Search']);Detection
Web Server Log Pattern
Look for SQL metacharacters in residents.php requests:
grep -i "residents\.php" /var/log/apache2/access.log \
| grep -iE "('|--|union|select|drop|insert|;|%27|%3B)"SIEM Query (Splunk)
index=web sourcetype=access_combined uri_path="*/residents.php"
| regex _raw="(?i)(union|select|insert|drop|--|\x27|%27)"
| stats count by src_ip, uri_query
| where count > 5Risk Context
While the affected system is a small open-source project targeting local government offices, the sensitivity of the data stored — resident names, addresses, IDs, household information — makes exploitation especially harmful. Barangay offices in the Philippines frequently operate on limited IT budgets with minimal security oversight, increasing the likelihood of unpatched deployments remaining in production.
Attackers targeting this class of application may seek to:
- Harvest PII for identity fraud or social engineering
- Demonstrate capability against government-adjacent infrastructure
- Access demographic data for targeted phishing campaigns