Skip to content

[JS]: Web Cache Deception #811

Closed
Closed
@aydinnyunus

Description

@aydinnyunus

Query PR

github/codeql#15180

Language

Javascript

CVE(s) ID list

CWE

CWE-525: Use of Web Browser Cache Containing Sensitive Information

Report

I created a new CodeQL query to detect potential Web Cache Deception vulnerabilities in web applications. Web Cache Deception is a security vulnerability where attackers trick a server into caching sensitive information, which they can later access. This query aims to identify code patterns that might make an application susceptible to this type of attack.

Steps To Reproduce:

  • codeql database create wcd --language=javascript --source-root "ql/src/Security/CWE-525/"
  • In VSCode, Run the following query
/**
 * @name Web Cache Deception in Express
 * @description A caching system has been detected on the application and is vulnerable to web cache deception. By manipulating the URL it is possible to force the application to cache pages that are only accessible by an authenticated user. Once cached, these pages can be accessed by an unauthenticated user.
 * @kind problem
 * @problem.severity error
 * @security-severity 9
 * @precision medium
 * @id js/web-cache-deception-express
 * @tags javascript
 *       cwe-525
 *       bug
 */

import javascript
import WebCacheDeceptionLib

from WebCacheDeception::Sink httpHandleFuncCall
where httpHandleFuncCall.toString().matches("%*%")
select httpHandleFuncCall, httpHandleFuncCall + " is used as wildcard endpoint."


Are you planning to discuss this vulnerability submission publicly? (Blog Post, social networks, etc).

  • Yes
  • No

Blog post link

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    All For OneSubmissions to the All for One, One for All bounty

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions