Skip to content
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

Analysis for CodeQL query Inclusion of functionality from an untrusted source #5297

Closed
10 of 19 tasks
roslynwythe opened this issue Aug 24, 2023 · 8 comments
Closed
10 of 19 tasks
Assignees
Labels
Complexity: Medium Feature: Code Alerts role: front end Tasks for front end developers size: 1pt Can be done in 4-6 hours
Milestone

Comments

@roslynwythe
Copy link
Member

roslynwythe commented Aug 24, 2023

Prerequisite

  1. Be a member of Hack for LA. (There are no fees to join.) If you have not joined yet, please follow the steps on our Getting Started page.
  2. Before you claim or start working on an issue, please make sure you have read our How to Contribute to Hack for LA Guide.

Overview

We need to analyze the query Inclusion of functionality from an untrusted source which appears in the CodeQL code scan results, and we need to make recommendations about the disposition of each specific alert found with that query. Analysis and Recommendations will be recorded in the spreadsheet: HfLA website: CodeQL scan alerts (issue #5060)1

Action Items

  • Open the spreadsheet HfLA website: CodeQL scan alerts - issue Create Issues for Analysis of CodeQL alerts #50601
  • From the code scanning results page2 browse to an alert with query type Inclusion of functionality from an untrusted source. Copy the query, severity level, description, and recommendation text from the webpage into a new row in the CodeQL query types sheet.
  • Observe the query tags listed on the left column of the webpage. If the tag security is listed, check the "Security Alert?" column of the spreadsheet.
  • Add your analysis and recommendation
    • In the "recommended action" column, select from the following: dismiss as test, dismiss as false positive, dismiss as won't fix, change code, or varies by instance
  • Populate a row in the Alert Instances sheet for each alert instance in the code scanning results page2; Complete the query, alert # and file:line columns
    • If the recommendation is fix code, populate these columns:
      • Line of current code
      • Recommended line of code
      • web page - URL of the affected web page, for testing purposes
      • test procedure- describe the process which can be used after the code fix has been made, to check that the change has not broken anything.
  • After all instances have been recorded in the sheet, add the ready for dev lead label to this issue and move it to the Questions/In Review column

For merge team/dev lead

  • To review this issue:
    • Locate the row in the CodeQL query types sheet. All columns should be populated.
    • Locate the rows in theAlert Instances. There should be a row for each instance of the alert in the code scanning results page2. For each row:
      • If the recommendation is change code, all columns must be completed with the exception of Link to Issue
      • If the recommendation is to dismiss, none of the remaining columns are required (as indicated on the sheet)
  • Remove the ready for dev lead label and close the issue
  • Check off the Issue in Create Issues for Analysis of CodeQL alerts #5060

Resources/Instructions

Footnotes

  1. spreadsheet: HfLA website: CodeQL scan alerts - issue #5060 2

  2. Code scanning results page 2 3

@roslynwythe roslynwythe added Feature Missing This label means that the issue needs to be linked to a precise feature label. role missing size: missing labels Aug 24, 2023
@github-actions

This comment was marked as outdated.

@roslynwythe roslynwythe added Complexity: Medium role: front end Tasks for front end developers size: 1pt Can be done in 4-6 hours Feature: Code Alerts labels Aug 24, 2023
@Josiah-O Josiah-O added this to the 02. Security milestone Aug 26, 2023
@ExperimentsInHonesty ExperimentsInHonesty removed role missing Feature Missing This label means that the issue needs to be linked to a precise feature label. labels Aug 27, 2023
@freaky4wrld freaky4wrld self-assigned this Nov 8, 2023
Copy link

github-actions bot commented Nov 8, 2023

Hi @freaky4wrld, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:-
i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?)
ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

@freaky4wrld
Copy link
Member

freaky4wrld commented Nov 8, 2023

ETA - 12/11/23 EOD
Availability - In evenings from 5 PM-11 PM

@freaky4wrld freaky4wrld added the ready for dev lead Issues that tech leads or merge team members need to follow up on label Nov 12, 2023
@freaky4wrld
Copy link
Member

I'm just not sure with the test procedure and the web page column in the Alert Instances sheet so left blank, can you please suggest what should I mention there.

@freaky4wrld
Copy link
Member

@roslynwythe the issue is complete and need to reviewed.... if anything has to be changed please tag me here

@roslynwythe
Copy link
Member Author

roslynwythe commented Nov 15, 2023

Hi @freaky4wrld Thank you for the analysis and recommendations. Based on your recommendations, we will create two new issues for the code changes to the files, and in each case we need to ask the developer to do some sort of testing to make sure nothing was broken. I will use the information you provide in web page and test procedure to guide the dev in testing.

Let me ask you, if you were responsible for making the recommeded code changes, how would you test them? If that babel script failed to load, how would we know?

@freaky4wrld
Copy link
Member

freaky4wrld commented Nov 15, 2023

@roslynwythe well there could be various methods:

  • the most simple would be using the console and look for any issues with the script or its integrity
  • another one could be using the `network tab and look for the external scripts failure
  • maybe using a fallback mechanism with <noscript> tag indicating a failure in the script loading
  • Or the best would be deliberately tampering the babel script or introduce an error in the script URL to simulate a tampered or failed script and observing its behaviour.

@roslynwythe
Copy link
Member Author

Thank you @freaky4wrld for your analysis and recommendations regarding this security alert. This issue will be closed as completed. A follow-up issue will be created for the code change and testing. If you have an interest in writing that issue, please let me know via DM on Slack.

@roslynwythe roslynwythe removed the ready for dev lead Issues that tech leads or merge team members need to follow up on label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Medium Feature: Code Alerts role: front end Tasks for front end developers size: 1pt Can be done in 4-6 hours
Projects
Development

No branches or pull requests

4 participants