From 35f9cd130ad697bc6137ed61f40985108474d92c Mon Sep 17 00:00:00 2001 From: Brendan H Date: Fri, 28 Sep 2018 17:04:48 -0700 Subject: [PATCH] [bug fix] Allow analyzeCookies to check for cookies with Uppercase names (#2467) * [Bug Fix] Allow analyzeCookies to check for uppercase cookie names * Added Uppercase cookie to test case * Added Uppercase cookie to test case --- src/wappalyzer.js | 4 ++-- src/wappalyzer.spec.js | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/wappalyzer.js b/src/wappalyzer.js index b36e6fb2e..60a4f6e60 100644 --- a/src/wappalyzer.js +++ b/src/wappalyzer.js @@ -629,10 +629,10 @@ class Wappalyzer { Object.keys(patterns).forEach((cookieName) => { if (typeof patterns[cookieName] !== 'function') { - cookieName = cookieName.toLowerCase(); + const cookieNameLower = cookieName.toLowerCase(); promises.push(asyncForEach(patterns[cookieName], (pattern) => { - const cookie = cookies.find(_cookie => _cookie.name.toLowerCase() === cookieName); + const cookie = cookies.find(_cookie => _cookie.name.toLowerCase() === cookieNameLower); if (cookie && pattern.regex.test(cookie.value)) { addDetected(app, pattern, 'cookies', cookie.value, cookieName); diff --git a/src/wappalyzer.spec.js b/src/wappalyzer.spec.js index b844b716d..ea68c22e0 100644 --- a/src/wappalyzer.spec.js +++ b/src/wappalyzer.spec.js @@ -12,6 +12,11 @@ const appsJson = { test: 'test', }, }, + appUppercaseCookies: { + cookies: { + Test: 'Test', + }, + }, appHeaders: { headers: { 'X-Powered-By': 'test', @@ -111,6 +116,10 @@ describe('Wappalyzer', () => { expect(apps).to.have.any.keys('appCookies'); }); + it('should identify technologies using uppercase named cookies', () => { + expect(apps).to.have.any.keys('appUppercaseCookies'); + }); + it('should identify technologies using JavaScript', () => { expect(apps).to.have.any.keys('appJs'); });