MITIGATING LOCAL STORAGE AND SESSION STORAGE VULNERABILITIES THROUGH SECURE MIDDLEWARE

Authors

  • Khadija Haider Corresponding Author,Fawad Nasim,Saif Ali Author

Abstract

Modern web applications frequently use client-side storage mechanisms, such as localStorage and sessionStorage, to store authentication tokens and user data due to their convenience and performance benefits. However, these storage methods lack built-in security controls, making them highly vulnerable to client-side attacks, particularly Cross-Site Scripting (XSS) and Man-in-the-Browser (MitB) attacks. Unlike cookies secured with HttpOnly and Secure flags, data stored in localStorage is fully accessible via JavaScript, allowing attackers to inject malicious scripts, steal authentication tokens, and impersonate legitimate users. Existing security measures, including Content Security Policies (CSPs), token encryption, and secure cookies, offer partial solutions but fail to provide a comprehensive defense against these threats. To address these vulnerabilities, this research proposes a secure middleware model for public RESTful APIs that eliminates the need for client-side authentication storage. The proposed solution centralizes authentication token management on the server, enforces real-time security monitoring, and implements fine-grained access control mechanisms to restrict unauthorized access. By shifting security responsibilities away from the client-side and ensuring secure session handling, the middleware significantly reduces the attack surface while maintaining usability and performance. This research contributes to the ongoing efforts in web security by offering a practical and scalable approach to mitigating client-side storage vulnerabilities, thereby enhancing the overall security posture of modern web applications.

Downloads

Download data is not yet available.

Downloads

Published

2025-04-12

Issue

Section

ENGLISH

How to Cite

MITIGATING LOCAL STORAGE AND SESSION STORAGE VULNERABILITIES THROUGH SECURE MIDDLEWARE. (2025). Al-Aasar, 2(1), 523-540. https://al-aasar.com/index.php/Journal/article/view/213