Skip to content

Conversation

@carmithersh
Copy link
Owner

No description provided.

@github-actions
Copy link

🚨 Frogbot scanned this pull request and found the below:

📦 Vulnerable Dependencies

✍️ Summary

SEVERITY CONTEXTUAL ANALYSIS DIRECT DEPENDENCIES IMPACTED DEPENDENCY FIXED VERSIONS CVES

High
Not Covered pip:22.0.2 pip 22.0.2 - CVE-2018-20225

Medium
Not Applicable setuptools:59.6.0 setuptools 59.6.0 [65.5.1] CVE-2022-40897

🔬 Research Details

[ CVE-2018-20225 ] pip 22.0.2

Description:
An issue was discovered in pip (all versions) because it installs the version with the highest version number, even if the user had intended to obtain a private package from a private index. This only affects use of the --extra-index-url option, and exploitation requires that the package does not already exist in the public index (and thus the attacker can put the package there with an arbitrary version number). NOTE: it has been reported that this is intended functionality and the user is responsible for using --extra-index-url securely

[ CVE-2022-40897 ] setuptools 59.6.0

Description:
Python Packaging Authority (PyPA) setuptools before 65.5.1 allows remote attackers to cause a denial of service via HTML in a crafted package or custom PackageIndex page. There is a Regular Expression Denial of Service (ReDoS) in package_index.py.


@github-actions
Copy link

hashlib.md5(encrypted_password)

at pythonExample/pythonProj.py (line 16)

🎯 Static Application Security Testing (SAST) Vulnerability

Severity Finding

Medium
Unsafe Hash Algorithm
Full description

Overview

An unsafe hash algorithm vulnerability occurs when using a known insecure hash algorithm.
A hash algorithm accepts arbitrary input and generates a hash value - a fixed-length output
that can be used to verify the integrity of data, such as passwords or files.
An insecure hash algorithm in an algorithm that an attacker can use to generate
the same hash value for different input data within a reasonable amount of time
("hash collision attack").

Query operation

In this query we look for any usage of weak hash algorithms

Vulnerable example

from flask import Flask, request
import hashlib

app = Flask(__name__)

@app.route('/login', methods=['POST'])
def login():
    username = request.form.get('username')
    password = request.form.get('password')

    # Vulnerable hashing mechanism (MD5)
    hashed_password = hashlib.md5(password.encode()).hexdigest()

    if check_password(username, hashed_password):
        return 'Login successful'
    else:
        return 'Login failed'

if __name__ == '__main__':
    app.run()

In this example, the application uses the MD5 hashing algorithm
to hash the user's password before storage. MD5 is considered a weak hashing algorithm,
vulnerable to various attacks, including collision attacks and precomputed lookup tables
(hash inversion).

Remediation

Replace any usage of the md5 and sha1 hash algorithms with stronger hash algorithms such
as sha256 -

@app.route('/login', methods=['POST'])
def login():
    username = request.form.get('username')
    password = request.form.get('password')

-    hashed_password = hashlib.md5(password.encode()).hexdigest()
+    hashed_password = hashlib.sha256(password.encode()).hexdigest()

if check_password(username, hashed_password):
    return 'Login successful'
else:
    return 'Login failed'


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants