Skip to content

Commit 6dbb390

Browse files
committed
Add workflow for handling Mobb fixes from CodeQL reports and create example for XSS vulnerability
1 parent 01364e6 commit 6dbb390

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/test-mobb-pr.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Mobb fix from CodeQL reports
2+
on:
3+
workflow_run:
4+
workflows: ["CodeQL"] # This workflow is triggered when the name specified here is triggered. In CodeQL Default Code Scanning Setup, this name is "CodeQL", if you are using CodeQL Advanced Setup, you may need to change this if you have a different workflow name.
5+
types:
6+
- completed
7+
jobs:
8+
handle_codeql_scan:
9+
runs-on: ubuntu-latest
10+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
11+
permissions:
12+
pull-requests: write
13+
security-events: write
14+
statuses: write
15+
contents: write
16+
issues: write
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
ref: ${{ github.event.workflow_run.head_sha }}
22+
- uses: ./
23+
with:
24+
mobb-api-token: ${{ secrets.MOBB_API_TOKEN }}
25+
github-token: ${{ secrets.GITHUB_TOKEN }}
26+
# Optional: specify organization and project
27+
# organization-id: "your-org-id"
28+
# mobb-project-name: "Your Project Name"

xss-example.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var urlParams = new URLSearchParams(window.location.search);
2+
var name = urlParams.get('name');
3+
4+
var unsafe_div = window.document.getElementById("vulnerable-div");
5+
unsafe_div.innerHTML = "Hello " + name;

0 commit comments

Comments
 (0)