-
Notifications
You must be signed in to change notification settings - Fork 63
Firefox port #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Firefox port #16
Changes from all commits
a5315ef
bc5ac95
c61942a
9edc2fd
32f43b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| .DS_Store | ||
| web-ext-artifacts/* |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -12,23 +12,19 @@ Client Side Protype pollution Scanner | |||||
|
|
||||||
|
|
||||||
| ### How to use? | ||||||
| <ol> | ||||||
| <li>Clone the repo</li> | ||||||
| <li>Install addon | ||||||
|
|
||||||
| * In chrome, | ||||||
| * Go to More Tools -> Extenstions | ||||||
| * Enable Developer Mode | ||||||
| * Click on "Load unpacked" and select the cloned repo folder. | ||||||
|
|
||||||
| </li> | ||||||
| <li>Visit the websites you want to test</li> | ||||||
| </ol> | ||||||
|
|
||||||
| * Clone the repo | ||||||
| * Temporaty install | ||||||
| * In Firefox, go to `about:debugging#/runtime/this-firefox` | ||||||
| * Click on "Load temporaty add-on" and select `manifest.json` from the cloned repo folder. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: Correct the spelling of “temporaty” to “temporary” in the add-on installation step. Prompt for AI agents
Suggested change
|
||||||
| * Persistent install | ||||||
| * Build `npm install --global web-ext` & `web-ext build` or `npx web-ext build` | ||||||
| * After executing commands, an extension file should appear in ./web-ext-artifacts/ppscan-{Version number}.zip | ||||||
| * To install an extension from a file, switch `xpinstall.signatures.required parameter` to `false` in Firefox on `about:config` page. | ||||||
| * Click "Install add-on from file" on `about:addons` page and select ppscan-{Version number}.zip | ||||||
| * Visit the websites you want to test | ||||||
|
|
||||||
| It only checks for vulnerable location parsers. | ||||||
|
|
||||||
|
|
||||||
| ### Examples | ||||||
| 1. https://msrkp.github.io/pp/1.html | ||||||
| 2. https://msrkp.github.io/pp/2.html | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| <html> | ||
|
|
||
| <head> | ||
|
|
||
| <meta http-equiv="content-type" content="text/html; charset=utf-8"> | ||
| </head> | ||
|
|
||
| <body> | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,3 +1,5 @@ | ||||||
| var chrome = browser; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: This will throw in environments where Prompt for AI agents
Suggested change
|
||||||
|
|
||||||
| const databaseUrl = chrome.extension.getURL('/database.csv'); | ||||||
|
|
||||||
| /* initialize */ | ||||||
|
|
@@ -7,11 +9,12 @@ setBadgeCount(0); | |||||
|
|
||||||
| /* setup listeners */ | ||||||
| chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => { | ||||||
| found.add(msg); | ||||||
| sourceUrl = new URL(msg); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Declare Prompt for AI agents
Suggested change
|
||||||
| found.add(JSON.stringify({ domain: sourceUrl.origin, type: 'Active Mode', file: sourceUrl.href, lineCol: 0 })); | ||||||
| setBadgeCount(found.size); | ||||||
| }); | ||||||
|
|
||||||
| chrome.extension.onConnect.addListener((port) => { | ||||||
| chrome.runtime.onConnect.addListener((port) => { | ||||||
| console.log('[>] New Session ', port); | ||||||
| if (port.name == "logger") { | ||||||
| port.onMessage.addListener((msg) => { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,3 +1,5 @@ | ||||||
| var chrome = browser; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Unconditionally assigning Prompt for AI agents
Suggested change
|
||||||
|
|
||||||
| document.addEventListener('TriggerBrute', () => { | ||||||
| var iframe = document.createElement('iframe'); | ||||||
| iframe.addEventListener('load', () => { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| var chrome = browser; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Guard against Prompt for AI agents |
||
|
|
||
| var PAYLOADS = [ | ||
| // ['XSS Prototype #1', 'x[__proto__][e32a5ec9c99]', 'ddcb362f1d60', ], | ||
| // ['XSS Prototype #2', 'x.__proto__.e32a5ec9c99','ddcb362f1d60', ], | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,6 @@ | ||||||
| var port = chrome.extension.connect({ | ||||||
| var chrome = browser; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: Directly assigning Prompt for AI agents
Suggested change
|
||||||
|
|
||||||
| var port = chrome.runtime.connect({ | ||||||
| name: "logger" | ||||||
| }); | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,3 +1,5 @@ | ||||||
| var chrome = browser; | ||||||
|
|
||||||
| const DEBUG = false; | ||||||
|
|
||||||
| const blacklist = [ | ||||||
|
|
@@ -107,8 +109,7 @@ const check = ({ requestUri, initiator }) => { | |||||
| if (blacklist.indexOf(requestUri + ':' + lineCol) != -1) { | ||||||
| return; | ||||||
| } | ||||||
|
|
||||||
| found.add(JSON.stringify({ domain: initiator, type: name, file: requestUri, lineCol })) | ||||||
| found.add(JSON.stringify({ domain: new URL(initiator).origin, type: name, file: requestUri, lineCol })) | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Guard against missing Prompt for AI agents
Suggested change
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good |
||||||
| setBadgeCount(found.size); | ||||||
| }); | ||||||
| }) | ||||||
|
|
@@ -120,9 +121,9 @@ const filter = { | |||||
| types: ["script"] | ||||||
| }; | ||||||
|
|
||||||
| const scan = ({ method, url, initiator }) => { | ||||||
| const scan = (request) => { | ||||||
| // if (method == "GET") { | ||||||
| check({ requestUri: url, initiator }); | ||||||
| check({ requestUri: request.url, initiator: request.originUrl }); | ||||||
| // } | ||||||
| }; | ||||||
|
|
||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: Fix the spelling of “Temporaty” to “Temporary” in the installation heading for clarity.
Prompt for AI agents