diff --git a/.github/workflows/amplify.yml b/.github/workflows/amplify.yml new file mode 100644 index 00000000..934c0d3c --- /dev/null +++ b/.github/workflows/amplify.yml @@ -0,0 +1,23 @@ +# .github/workflows/amplify.yml +--- +name: Amplify Security +on: + pull_request: {} + workflow_dispatch: {} + push: + branches: ["master", "main"] + +permissions: + contents: read + id-token: write + +jobs: + amplify-security-scan: + name: Amplify Security Scan + runs-on: ubuntu-latest + if: (!github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]') + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Amplify Runner + uses: amplify-security/runner-action@main diff --git a/xss-example.js b/xss-example.js index c39e9a03..eee8ab51 100644 --- a/xss-example.js +++ b/xss-example.js @@ -4,4 +4,5 @@ var urlParams = new URLSearchParams(window.location.search); var username = urlParams.get('username'); var unsafe_div = window.document.getElementById("vulnerable-div"); -unsafe_div.innerHTML = "Hello to you "; +// here's an XSS: +unsafe_div.innerHTML = "Hello to you " + username;