From e65b8d901a1e8c8eb86ca8eff43fb03b07d8c69f Mon Sep 17 00:00:00 2001 From: CxSean Date: Tue, 4 May 2021 22:30:22 +0000 Subject: [PATCH 01/10] Create cx.config --- cx.config | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 cx.config diff --git a/cx.config b/cx.config new file mode 100644 index 00000000..d01e4111 --- /dev/null +++ b/cx.config @@ -0,0 +1,34 @@ +{ + "application": "DSVW", + "branches": ["develop", "master"], + "bugTracker": "JIRA", + "jira": { + "project": "DSVW", + "issue_type": "Bug", + "opened_status": ["Open","Reopen"], + "closed_status": ["Closed","Done"], + "open_transition": "Reopen Issue", + "close_transition": "Close Issue", + "close_transition_field": "resolution", + "close_transition_value": "Done", + "priorities": { + "High": "High", + "Medium": "Medium", + "Low": "Low" + }, + "fields": [ + { + "type": "result", + "name": "application", + "jira_field_name": "Application", + "jira_field_type": "label" + }, + { + "type": "result", + "name": "category", + "jira_field_name": "Category", + "jira_field_type": "label" + } + ] + } +} From 4920ea37ea97e5a9b9ec3533fa8d3faec4004da1 Mon Sep 17 00:00:00 2001 From: CxSean Date: Tue, 4 May 2021 22:55:20 +0000 Subject: [PATCH 02/10] Create main.yml --- .github/workflows/main.yml | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..69d993ac --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,54 @@ +# This is a basic workflow to help you get started with Actions +name: CxFlow + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Cxflow Action + - name: Checkmarx CxFlow Action + # You may pin to the exact commit or the version. + # uses: checkmarx-ts/checkmarx-cxflow-github-action@95d2a8c86d754ddbccc638a7e1bb8e99a8d2244f + uses: checkmarx-ts/checkmarx-cxflow-github-action@v1.1 + with: + scanners: sast + # Provide Checkmarx URL + checkmarx_url: ${{secrets.CHECKMARX_URL}} + # Provide team + team: /CxServer + # Provide Checkmarx Username + checkmarx_username: ${{secrets.CHECKMARX_USERNAME}} + # Provide Checkmarx Password + checkmarx_password: ${{secrets.CHECKMARX_PASSWORD}} + # Provide Checkmarx Client Secret + checkmarx_client_secret: ${{secrets.CHECKMARX_CLIENT_SECRET}} + # Select a Checkmarx Project + project: WebGoat-GitHub-action + # Select an Application Name used by downstream bug tracker systems + app: WebGoat + # Select a Checkmarx Preset + #preset: # optional, default is Checkmarx Default + # Break build based on Checkmarx findings? + #break_build: # optional + # Incremental Scans? + incremental: true + # GitHub API Token (note: you don't have to create secrets.GITHUB_TOKEN, it is created automatically and will not appear in your repo's custom secrets) + github_token: ${{secrets.GITHUB_TOKEN}} + # extra parameters + params: --bug-tracker=jira --config=cx.config --repo-name=WebGoat --namespace=scasey --branch=master --jira.url=${{secrets.JIRA_URL}} --jira.username=${{secrets.JIRA_USER}} --jira.token=${{secrets.JIRA_TOKEN}} From c1ea2c142bce53329757bf385fc63cf01ca9107c Mon Sep 17 00:00:00 2001 From: CxSean Date: Wed, 5 May 2021 04:29:16 +0000 Subject: [PATCH 03/10] Update cx.config Update project name --- cx.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cx.config b/cx.config index d01e4111..df93e637 100644 --- a/cx.config +++ b/cx.config @@ -1,9 +1,9 @@ { - "application": "DSVW", + "application": "WebGoat", "branches": ["develop", "master"], "bugTracker": "JIRA", "jira": { - "project": "DSVW", + "project": "WebGoat", "issue_type": "Bug", "opened_status": ["Open","Reopen"], "closed_status": ["Closed","Done"], From d35e4bc48f7de3e5146eb61f271cd2f6983494c7 Mon Sep 17 00:00:00 2001 From: CxSean Date: Wed, 5 May 2021 04:58:23 +0000 Subject: [PATCH 04/10] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 69d993ac..eb528375 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,4 +51,4 @@ jobs: # GitHub API Token (note: you don't have to create secrets.GITHUB_TOKEN, it is created automatically and will not appear in your repo's custom secrets) github_token: ${{secrets.GITHUB_TOKEN}} # extra parameters - params: --bug-tracker=jira --config=cx.config --repo-name=WebGoat --namespace=scasey --branch=master --jira.url=${{secrets.JIRA_URL}} --jira.username=${{secrets.JIRA_USER}} --jira.token=${{secrets.JIRA_TOKEN}} + params: --bug-tracker=jira --config=cx.config --repo-name=WebGoat --branch=master --jira.url=${{secrets.JIRA_URL}} --jira.username=${{secrets.JIRA_USER}} --jira.token=${{secrets.JIRA_TOKEN}} From 3c98ccca909763688b8aeed3ed1789a6af174b78 Mon Sep 17 00:00:00 2001 From: CxSean Date: Wed, 5 May 2021 05:11:28 +0000 Subject: [PATCH 05/10] Update cx.config --- cx.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cx.config b/cx.config index df93e637..d46b2030 100644 --- a/cx.config +++ b/cx.config @@ -3,7 +3,7 @@ "branches": ["develop", "master"], "bugTracker": "JIRA", "jira": { - "project": "WebGoat", + "project": "WEBGOAT", "issue_type": "Bug", "opened_status": ["Open","Reopen"], "closed_status": ["Closed","Done"], From 7ebed2652e3b8fe9297c6f708351e648ed4626bb Mon Sep 17 00:00:00 2001 From: CxSean Date: Wed, 23 Jun 2021 09:53:06 -0400 Subject: [PATCH 06/10] Update README --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index a5ce616c..796d4e2b 100644 --- a/README +++ b/README @@ -1,6 +1,7 @@ ***************************** Webgoat.NET ********************************** * Source Code: https://github.com/jerryhoff/WebGoat.NET * Download zip: https://github.com/jerryhoff/WebGoat.NET/zipball/master +*adding an additional line to kick off a scan. **************************************************************************** This web application is a learning platform that attempts to teach about From 67307712edbfd1bff0db4300728b1ae1c01aae92 Mon Sep 17 00:00:00 2001 From: CxSean Date: Mon, 11 Oct 2021 10:51:37 -0400 Subject: [PATCH 07/10] Update DatabaseUtilities.cs --- WebGoat/Code/DatabaseUtilities.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WebGoat/Code/DatabaseUtilities.cs b/WebGoat/Code/DatabaseUtilities.cs index c91f1042..9b83332c 100644 --- a/WebGoat/Code/DatabaseUtilities.cs +++ b/WebGoat/Code/DatabaseUtilities.cs @@ -9,6 +9,8 @@ using System.Configuration; using Mono.Data.Sqlite; +//adding comment + namespace OWASP.WebGoat.NET { public class DatabaseUtilities @@ -250,4 +252,4 @@ public DataTable GetPostingByID(int id) } } -} \ No newline at end of file +} From 5f55729527f453f8450ad275dcfdc3b1c9b4cbcd Mon Sep 17 00:00:00 2001 From: CxSean Date: Thu, 5 Sep 2024 19:09:55 -0400 Subject: [PATCH 08/10] Update AddNewUser.aspx.cs --- WebGoat/AddNewUser.aspx.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebGoat/AddNewUser.aspx.cs b/WebGoat/AddNewUser.aspx.cs index 363be276..077ada1e 100644 --- a/WebGoat/AddNewUser.aspx.cs +++ b/WebGoat/AddNewUser.aspx.cs @@ -9,7 +9,7 @@ using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; - +// adding a comment namespace OWASP.WebGoat.NET { public partial class AddNewUser : System.Web.UI.Page From aadd74048588a2a08b61350f4be2ddd6ea829805 Mon Sep 17 00:00:00 2001 From: CxSean Date: Thu, 5 Sep 2024 21:13:58 -0400 Subject: [PATCH 09/10] add Dockerfile --- Dockerfile.dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Dockerfile.dockerfile diff --git a/Dockerfile.dockerfile b/Dockerfile.dockerfile new file mode 100644 index 00000000..9802a862 --- /dev/null +++ b/Dockerfile.dockerfile @@ -0,0 +1,20 @@ +# Use an official Node.js runtime as the parent image +FROM node:16 + +# Set the working directory in the container +WORKDIR /usr/src/app + +# Copy the package.json and package-lock.json to the working directory +COPY package*.json ./ + +# Install the app dependencies inside the container +RUN npm install + +# Copy the rest of the application code into the container +COPY . . + +# Specify the port the app runs on +EXPOSE 3000 + +# Define the command to run the app +CMD ["node", "app.js"] From 4e391d97dbc918443ab95df642283628505c6acc Mon Sep 17 00:00:00 2001 From: Sean Casey Date: Wed, 26 Feb 2025 10:35:29 -0500 Subject: [PATCH 10/10] triage sql injection --- WebGoat/App_Code/DB/MySqlDbProvider.cs | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/WebGoat/App_Code/DB/MySqlDbProvider.cs b/WebGoat/App_Code/DB/MySqlDbProvider.cs index 0bc79812..8b3f2853 100644 --- a/WebGoat/App_Code/DB/MySqlDbProvider.cs +++ b/WebGoat/App_Code/DB/MySqlDbProvider.cs @@ -347,24 +347,13 @@ public string GetPasswordByEmail(string email) string result = string.Empty; try { - using (MySqlConnection connection = new MySqlConnection(_connectionString)) { - //get data - string sql = "select * from CustomerLogin where email = '" + email + "';"; - MySqlDataAdapter da = new MySqlDataAdapter(sql, connection); - DataSet ds = new DataSet(); - da.Fill(ds); - - //check if email address exists - if (ds.Tables[0].Rows.Count == 0) - { - result = "Email Address Not Found!"; - } - - string encoded_password = ds.Tables[0].Rows[0]["Password"].ToString(); - string decoded_password = Encoder.Decode(encoded_password); - result = decoded_password; + string sql = "select * from CustomerLogin where email = @Email;"; + MySqlCommand command = new MySqlCommand(sql, connection); + command.Parameters.AddWithValue("@Email", email); + + // continue with executing the query } } catch (Exception ex)