Meta-Analysis

A Comparative Analysis of SQL Injection and XSS Vulnerabilities: From Exploitation to Secure Implementation in PHP Applications

ISSN 2979-8582  ·  Article No. 005

Orji Cyrus Ebere MCPN Ukachukwu, Theddius N Anumudu, Damain U

Publication Details

Publication Date
10/08/2026
Volume / Issue
Vol 1, Issue 3 (2026)
Article No.
005
Journal
British Journal of Contemporary Research
Received
06 Jul 2026
Views
84
Downloads
17
Affiliations

Orji Cyrus Ebere MCPN: Department of Computer Science, Imo State Polytechnic Omuma Nigeria, Nigeria

Ukachukwu, Theddius N: Department of Computer Science, Imo State Polytechnic Omuma Nigeria

Anumudu, Damain U: Nigeria Navy College of Accounts and Finance Owerrinta, Nigeria

ORCID

OCEM 0009-0004-6389-4803

Abstract

SQL Injection (SQLi) and Cross-Site Scripting (XSS) persist as key security vulnerabilities in web applications, continuously featured in the OWASP Top 10. This research offers a thorough comparative investigation of these vulnerabilities by developing a dual-version PHP/MySQL web application-one designed to be vulnerable and the other safely implemented. The research illustrates SQL injection exploitation through authentication circumvention, UNION-based data retrieval, and Boolean-based blind injection methods, in addition to stored and reflected cross-site scripting assaults. The susceptible version utilizes insecure coding methodologies, such as string concatenation in SQL queries, unsanitized output, raw password storage, and absent access controls. The secure version employs prepared statements via PDO, output encoding with htmlspecialchars(), bcrypt for password hashing, session-based authentication, CSRF tokens, and extensive security headers. Experimental findings indicate that the secure implementation effectively neutralizes all exhibited attack avenues, attaining a 95% enhancement in security compared to the susceptible version. The automated testing suite, created with cURL and PHP, programmatically checks both versions, underscoring the significance of including security testing into the development lifecycle. This research offers pragmatic, evidence-based recommendations for developers creating secure PHP applications and enhances the scholarly discussion on online application security.

Keywords

SQL Injection Cross-Site Scripting Web Application Security PHP Security Prepared Statements XSS Prevention

License

CC BY 4.0

This article is published under the Creative Commons Attribution 4.0 International License . Free to read, share, and adapt with attribution.

Cite This Article

Orji Cyrus Ebere MCPN, Ukachukwu, Theddius N, Anumudu, Damain U (2026). A Comparative Analysis of SQL Injection and XSS Vulnerabilities: From Exploitation to Secure Implementation in PHP Applications. British Journal of Contemporary Research, 1(3), Article 005. https://doi.org/10.67693/BJCR-D756D3BR
Orji Cyrus Ebere MCPN. “A Comparative Analysis of SQL Injection and XSS Vulnerabilities: From Exploitation to Secure Implementation in PHP Applications.” British Journal of Contemporary Research, vol. 1, no. 3, 2026.
Orji Cyrus Ebere MCPN. “A Comparative Analysis of SQL Injection and XSS Vulnerabilities: From Exploitation to Secure Implementation in PHP Applications.” British Journal of Contemporary Research 1, no. 3.

Metadata

ISSN 2979-8582
DOI Prefix 10.67693
Tracking ID BEX_JUL_26_037

British Journal of Contemporary Research

Open Access · Peer Reviewed · Published by Bexford Publishing Ltd

Browse All Issues
Join Community