prayas7102 / NodejsSecurify

NodejsSecurify is an advanced NPM package designed to enhance the security of Node.js applications using AI/ML models. It provides a comprehensive set of security features and analysis capabilities to identify potential vulnerabilities and enforce best practices in accordance with OWASP guidelines.
https://www.npmjs.com/package/node-js-securify
MIT License
4 stars 5 forks source link

Automating Vulnerability Detection with Naive Bayes and Weighted Pickle Models #6

Open prayas7102 opened 3 weeks ago

prayas7102 commented 3 weeks ago

While utilizing the Naive Bayes classifier to detect brute force attacks, validate inputs, identify insecure authentication, and analyze security headers, the model currently trains separately for each JavaScript test file (.js, .jsx, .tsx, etc.). This process can be streamlined by generating a single (or multiple depending upon the vulnerability) weighted pickle model, which can be reused each time a JavaScript file is tested for vulnerabilities, improving efficiency and consistency.

Steps to be considered by the contributor:

  1. Organizing data and cleaning data.
  2. Training a model.

Files to be referred/altered for this change:

  1. DetectBruteForceAttack.ts
  2. DetectInputValidation.ts
  3. InsecureAuthentication.ts
  4. AnalyzeSecurityHeaders.ts
  5. Vulnerability.ts

Make sure the end user/developer (who downloads the NPM package) is able to smoothly run the NPM package after these changes.

Commit2Cosmos commented 1 day ago

Hi, following our discussion at #15 I would like to tackle this. Could you please elaborate on

Organizing data and cleaning data.

prayas7102 commented 23 hours ago

Hi, following our discussion at #15 I would like to tackle this. Could you please elaborate on

Organizing data and cleaning data.

organizing data: i was thinking if we can combine all csv data into one for training. (let me know your opinion):

image

cleaning data: as you can see in csv datasets there are rows in which the code contains letters, like this: \n, //, empty lines. example, see row no.s like 24, 29 in bruteForceDataset.csv