CVE-2022-2017 in Prison Management Systeminfo

Summary

by MITRE • 06/09/2022

A vulnerability was found in SourceCodester Prison Management System 1.0. It has been rated as critical. This issue affects some unknown processing of the file /pms/admin/visits/view_visit.php of the component Visit Handler. The manipulation of the argument id with the input 2%27and%201=2%20union%20select%201,2,3,4,5,6,7,user(),database()--+ leads to sql injection. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 06/10/2022

This vulnerability exists within the SourceCodester Prison Management System version 1.0, specifically in the visit handler component that processes requests through the /pms/admin/visits/view_visit.php file. The flaw represents a classic sql injection vulnerability that allows remote attackers to execute arbitrary database commands by manipulating the id parameter. The attack vector is particularly concerning as it can be initiated from external networks without requiring authentication or prior access to the system. The malicious payload 2%27and%201=2%20union%20select%201,2,3,4,5,6,7,user(),database()--+ demonstrates a sophisticated approach to bypassing input validation mechanisms while extracting sensitive database information including the current user credentials and database name.

The technical implementation of this vulnerability stems from improper input sanitization and inadequate parameter validation within the php application code. When the system processes the id parameter without proper escaping or prepared statement usage, it directly incorporates user-supplied data into sql query construction. This design flaw aligns with CWE-89 which specifically addresses sql injection vulnerabilities, and represents a critical weakness in the application's data handling procedures. The vulnerability operates at the application layer and can be exploited through standard http requests, making it highly accessible to threat actors who may leverage publicly available exploit code.

The operational impact of this vulnerability is severe and multifaceted, potentially allowing attackers to gain unauthorized access to sensitive prison management data including inmate records, visitor logs, and administrative information. The sql injection payload specifically designed to extract database user() and database() functions indicates that attackers could potentially escalate privileges or discover additional database structures. This vulnerability could enable data exfiltration, data manipulation, or complete system compromise, particularly given that the prison management system likely contains highly sensitive information about inmates, staff, and security protocols. The disclosure of exploit code further amplifies the risk as it provides readily available tools for attackers to exploit this weakness.

Mitigation strategies should focus on implementing proper input validation and parameterized queries to prevent sql injection attacks. The system administrators must immediately apply the vendor-supplied patches or upgrade to a newer version of the prison management system that addresses this vulnerability. Additionally, implementing web application firewalls, input sanitization routines, and regular security assessments can help prevent similar issues in the future. The use of prepared statements and stored procedures should be enforced throughout the application codebase to eliminate the possibility of sql injection through direct parameter concatenation. Organizations should also conduct comprehensive security audits of all database interactions and implement principle of least privilege access controls to limit potential damage from successful exploitation attempts. This vulnerability exemplifies the importance of following secure coding practices and adhering to established security frameworks that prevent such critical flaws from being introduced into production systems.

Responsible

VulDB

Reservation

06/07/2022

Disclosure

06/09/2022

Moderation

accepted

CPE

ready

Exploit

Download

EPSS

0.00673

KEV

no

Activities

very low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!