added stringlengths 32 32 | created int64 1,244B 1,694B | id stringlengths 40 40 | int_score int64 2 5 | metadata dict | score float64 2.31 5.25 | source stringclasses 1
value | text stringlengths 324 20.1k | num_lines int64 16 598 | avg_line_length float64 15.1 58.3 | max_line_length int64 33 179 | ast_depth int64 8 39 | length int64 101 3.8k | lang stringclasses 1
value | sast_codeql_findings stringlengths 1.1k 265k | sast_codeql_findings_count int64 1 45 | sast_codeql_success bool 1
class | sast_codeql_error stringclasses 1
value | cwe_ids listlengths 1 45 | rule_ids listlengths 1 45 | confidences listlengths 1 45 | severities listlengths 1 45 | messages listlengths 1 45 | line_starts listlengths 1 45 | line_ends listlengths 1 45 | column_starts listlengths 1 45 | column_ends listlengths 1 45 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2024-11-19T01:54:46.944693+00:00 | 1,691,682,979,000 | 3cf4d35d8fcd8899cdfcdee1d2eae8d9e0055ae6 | 3 | {
"blob_id": "3cf4d35d8fcd8899cdfcdee1d2eae8d9e0055ae6",
"branch_name": "refs/heads/maint",
"committer_date": 1691682979000,
"content_id": "d54b91643c8e2d5004ffda7fd2a6dc1aabb62c59",
"detected_licenses": [
"BSD-3-Clause",
"MIT"
],
"directory_id": "76f23cc69dc10c44bc7cf00b78e37db04c7a9c45",
"exte... | 2.625 | stackv2 | ## NDA AWS Token Generator
## Author: NIMH Data Archives
## http://ndar.nih.gov
## License: MIT
## https://opensource.org/licenses/MIT
import binascii
import hashlib
import logging
import xml.etree.ElementTree as etree
import sys
if sys.version_info[0] == 2:
import urllib2 as urllib_request
else... | 121 | 30.55 | 89 | 12 | 838 | python | [{"finding_id": "codeql_py/weak-sensitive-data-hashing_631a910934060c31_a55e6d18", "tool_name": "codeql", "rule_id": "py/weak-sensitive-data-hashing", "finding_type": "path-problem", "severity": "medium", "confidence": "high", "message": "[Sensitive data (password)](1) is used in a hashing algorithm (SHA1) that is inse... | 1 | true | [
"CWE-327"
] | [
"py/weak-sensitive-data-hashing"
] | [
"HIGH"
] | [
"MEDIUM"
] | [
"[Sensitive data (password)](1) is used in a hashing algorithm (SHA1) that is insecure for password hashing, since it is not a computationally expensive hash function.\n[Sensitive data (password)](2) is used in a hashing algorithm (SHA1) that is insecure for password hashing, since it is not a computationally expen... | [
39
] | [
null
] | [
23
] | [
47
] | |
2024-11-19T01:54:56.152867+00:00 | 1,691,566,580,000 | da9f86b3f19f4b8db14bc92c69aff0bf65193052 | 3 | {
"blob_id": "da9f86b3f19f4b8db14bc92c69aff0bf65193052",
"branch_name": "refs/heads/master",
"committer_date": 1691566580000,
"content_id": "0b359a50b1ac0200430fe8605d30abb4d93450e9",
"detected_licenses": [
"MIT"
],
"directory_id": "691b82da7c38a6c109088d8426ffa26175f4ff31",
"extension": "py",
"fi... | 2.75 | stackv2 | # -*- coding: utf-8 -*-
"""
定义一些任务的执行操作,将具体的操作从tasks.py里面抽离出来
每个任务需要饮用的模块放到函数里面引用,方便单独调试函数
"""
import requests
def get_link_status(url):
"""
请求地址,返回请求状态和内容
@param url:
@return:
"""
try:
resp = requests.get(url, timeout=5, verify=False)
except Exception:
return 500, ... | 255 | 32.4 | 90 | 22 | 2,159 | python | [{"finding_id": "codeql_py/request-without-cert-validation_1fcc7e933dc682b3_f0267f36", "tool_name": "codeql", "rule_id": "py/request-without-cert-validation", "finding_type": "problem", "severity": "medium", "confidence": "medium", "message": "This request may run without certificate validation because [it is disabled]... | 1 | true | [
"CWE-295"
] | [
"py/request-without-cert-validation"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
"This request may run without certificate validation because [it is disabled](1)."
] | [
16
] | [
null
] | [
16
] | [
58
] | |
2024-11-19T01:55:00.292200+00:00 | 1,626,602,180,000 | 4cc143dbe5c3ad84346deeb0ab47d8d7909a5671 | 3 | {
"blob_id": "4cc143dbe5c3ad84346deeb0ab47d8d7909a5671",
"branch_name": "refs/heads/master",
"committer_date": 1626602180000,
"content_id": "3c0775d90842c2982b4711dd629d2ecedba713a7",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "26f61d8631bce66d00d7a33029228d69083a7a9e",
"extension": "py"... | 2.625 | stackv2 | from socket import *
import ssl
import threading
import time
import re
import httplib
import struct
import string
import os
import sys
import socket as Socket
import select
class handler(threading.Thread):
def __init__(self,socket, port) :
threading.Thread.__init__(self)
self.socket=socket
... | 275 | 34.16 | 117 | 20 | 2,207 | python | [{"finding_id": "codeql_py/insecure-default-protocol_054ff290e728fb8b_d1f262aa", "tool_name": "codeql", "rule_id": "py/insecure-default-protocol", "finding_type": "problem", "severity": "medium", "confidence": "high", "message": "Call to deprecated method ssl.wrap_socket does not specify a protocol, which may result in... | 1 | true | [
"CWE-327"
] | [
"py/insecure-default-protocol"
] | [
"HIGH"
] | [
"MEDIUM"
] | [
"Call to deprecated method ssl.wrap_socket does not specify a protocol, which may result in an insecure default being used."
] | [
42
] | [
null
] | [
20
] | [
41
] | |
2024-11-19T01:55:03.064005+00:00 | 1,591,212,845,000 | bce621904fde631fcdfb18678cc86d6d7cfbdb9e | 3 | {
"blob_id": "bce621904fde631fcdfb18678cc86d6d7cfbdb9e",
"branch_name": "refs/heads/master",
"committer_date": 1591212845000,
"content_id": "1223fcb483eaa58c00113ba07ba720ce46c96339",
"detected_licenses": [
"Unlicense"
],
"directory_id": "b0f9d8fcfe5c7638b10a4c608c63c3f13cf848ee",
"extension": "py",... | 2.5625 | stackv2 | import re
import operator
from pprint import pprint
from collections import OrderedDict
from data.attrib_errors import error_dict
from ordered_set import OrderedSet
from tf_config import langsettings
# XML RE PATTERNS
commentFullRE = re.compile(r'^<!--.*?-->$')
commentStartRE = re.compile(r'^<!--.*')
commentStopRE ... | 251 | 39.98 | 118 | 27 | 2,332 | python | [{"finding_id": "codeql_py/bad-tag-filter_74fea561533991a0_f626c1e7", "tool_name": "codeql", "rule_id": "py/bad-tag-filter", "finding_type": "problem", "severity": "medium", "confidence": "high", "message": "This regular expression does not match comments containing newlines.", "remediation": "", "location": {"file_pat... | 2 | true | [
"CWE-116",
"CWE-116"
] | [
"py/bad-tag-filter",
"py/bad-tag-filter"
] | [
"HIGH",
"HIGH"
] | [
"MEDIUM",
"MEDIUM"
] | [
"This regular expression does not match comments containing newlines.",
"This regular expression does not match comments containing newlines."
] | [
10,
12
] | [
null,
null
] | [
32,
32
] | [
44,
38
] | |
2024-11-19T01:55:05.676443+00:00 | 1,587,456,200,000 | d7c864b9d839d081328447a4c1cebad91357bd00 | 3 | {
"blob_id": "d7c864b9d839d081328447a4c1cebad91357bd00",
"branch_name": "refs/heads/master",
"committer_date": 1587456200000,
"content_id": "6dcca9d1fb4f782f8b68dce023ee99f6059bb8aa",
"detected_licenses": [
"MIT"
],
"directory_id": "7b7d7be57b7ea8cb86ead21eed2e3e569967504e",
"extension": "py",
"fi... | 3.390625 | stackv2 | import pyperclip
import random
class User:
"""
Class that generates instances of users.
"""
user_list = [] # Empty contact list
def __init__(self, first_name, last_name, password):
'''
__init__ method that will define properties for objects
'''
self.first_name = fir... | 121 | 28.23 | 110 | 15 | 688 | python | [{"finding_id": "codeql_py/clear-text-logging-sensitive-data_04034a269b16f2b7_efd65f90", "tool_name": "codeql", "rule_id": "py/clear-text-logging-sensitive-data", "finding_type": "path-problem", "severity": "medium", "confidence": "high", "message": "This expression logs [sensitive data (password)](1) as clear text.\nT... | 1 | true | [
"CWE-312"
] | [
"py/clear-text-logging-sensitive-data"
] | [
"HIGH"
] | [
"MEDIUM"
] | [
"This expression logs [sensitive data (password)](1) as clear text.\nThis expression logs [sensitive data (password)](2) as clear text."
] | [
74
] | [
null
] | [
23
] | [
48
] | |
2024-11-19T01:55:15.615974+00:00 | 1,579,352,807,000 | c981201460e7d6370e3e2b31f272af2b7357966b | 4 | {
"blob_id": "c981201460e7d6370e3e2b31f272af2b7357966b",
"branch_name": "refs/heads/master",
"committer_date": 1579352807000,
"content_id": "55b67c01a91a8b2062f2c040618162859b667ba5",
"detected_licenses": [
"MIT"
],
"directory_id": "58c29c0eb774ea1ba41177e4fe08a736152e0099",
"extension": "py",
"fi... | 4.46875 | stackv2 | # to get current date and time
# we need to use the datetime library
from datetime import datetime,timedelta
current_date=datetime.now()
# the now function returns a datetime object
print('Today is: '+str(current_date))
# timedelta is used to define a period of time
one_day=timedelta(days=1)
yesterday=current_date-on... | 31 | 30.23 | 53 | 9 | 241 | python | [{"finding_id": "codeql_py/clear-text-logging-sensitive-data_f59ebcf14f60fac7_8bc96c51", "tool_name": "codeql", "rule_id": "py/clear-text-logging-sensitive-data", "finding_type": "path-problem", "severity": "medium", "confidence": "high", "message": "This expression logs [sensitive data (private)](1) as clear text.", "... | 2 | true | [
"CWE-312",
"CWE-312"
] | [
"py/clear-text-logging-sensitive-data",
"py/clear-text-logging-sensitive-data"
] | [
"HIGH",
"HIGH"
] | [
"MEDIUM",
"MEDIUM"
] | [
"This expression logs [sensitive data (private)](1) as clear text.",
"This expression logs [sensitive data (private)](1) as clear text."
] | [
27,
31
] | [
null,
null
] | [
7,
7
] | [
38,
48
] | |
2024-11-19T01:55:28.601143+00:00 | 1,605,757,181,000 | 3d9bd488bc7b0f5f7fb82d4b8ef7db6f6acab3d0 | 3 | {
"blob_id": "3d9bd488bc7b0f5f7fb82d4b8ef7db6f6acab3d0",
"branch_name": "refs/heads/master",
"committer_date": 1605757181000,
"content_id": "40e86470f3f9a931a47c0b618585a0fb42d2cb98",
"detected_licenses": [
"MIT"
],
"directory_id": "f0d4ba28ce781f8c8cd27e529447acac29c271db",
"extension": "py",
"fi... | 2.546875 | stackv2 | #!/usr/bin/env python
# coding: utf-8
# In[3]:
import numpy as np
import osmnx as ox, networkx as nx, geopandas as gpd, matplotlib.pyplot as plt
import networkx as nx
import pandas as pd
from folium import plugins
from folium.plugins import MarkerCluster
import json
import urllib.request
from urllib.request import R... | 103 | 26.04 | 119 | 16 | 967 | python | [{"finding_id": "codeql_py/partial-ssrf_29fa70e4c2feb476_47de49dc", "tool_name": "codeql", "rule_id": "py/partial-ssrf", "finding_type": "path-problem", "severity": "medium", "confidence": "medium", "message": "Part of the URL of this request depends on a [user-provided value](1).\nPart of the URL of this request depen... | 1 | true | [
"CWE-918"
] | [
"py/partial-ssrf"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
"Part of the URL of this request depends on a [user-provided value](1).\nPart of the URL of this request depends on a [user-provided value](2)."
] | [
44
] | [
null
] | [
33
] | [
66
] | |
2024-11-19T02:06:42.640441+00:00 | 1,527,915,296,000 | 4d76d20ccabac3441134ec1b9ffe7845813917b8 | 3 | {
"blob_id": "4d76d20ccabac3441134ec1b9ffe7845813917b8",
"branch_name": "refs/heads/master",
"committer_date": 1527915296000,
"content_id": "a221daa40eb5f6258dfd856b1326aa5fd3d130ef",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "2085ed042e115bf64584ee7c6385bcbc700dc8a1",
"extension": "py"... | 2.90625 | stackv2 | from numpy import *
from numpy.random import *
import matplotlib.pyplot as plt
import pandas as pd
from .factor import *
set_printoptions(linewidth=1e99)
seed(0)
class Book:
def __init__(self, nb_contract=10):
# making
nb_contract = int(nb_contract)
age_start = uniform(20, 60, nb_contract)
gender = choice([... | 79 | 21.8 | 77 | 16 | 520 | python | [{"finding_id": "codeql_py/clear-text-logging-sensitive-data_9c84eb61d7be7a4f_b59823e7", "tool_name": "codeql", "rule_id": "py/clear-text-logging-sensitive-data", "finding_type": "path-problem", "severity": "medium", "confidence": "high", "message": "This expression logs [sensitive data (private)](1) as clear text.", "... | 1 | true | [
"CWE-312"
] | [
"py/clear-text-logging-sensitive-data"
] | [
"HIGH"
] | [
"MEDIUM"
] | [
"This expression logs [sensitive data (private)](1) as clear text."
] | [
53
] | [
null
] | [
19
] | [
30
] | |
2024-11-19T02:06:56.057636+00:00 | 1,566,962,839,000 | a5c43d9f34e259432b2b76c452c5777a8a3357c3 | 3 | {
"blob_id": "a5c43d9f34e259432b2b76c452c5777a8a3357c3",
"branch_name": "refs/heads/master",
"committer_date": 1566962839000,
"content_id": "f4fa3744edc716698de280fe6323425d2292345f",
"detected_licenses": [
"MIT"
],
"directory_id": "05f60b5fd34aa8d7306bc34cadebcc09ea6a4e36",
"extension": "py",
"fi... | 2.703125 | stackv2 | import os
import re
from urllib.parse import urlparse
from tqdm import tqdm
import zipfile
import tarfile
import gzip
import requests
class Storage():
def __init__(self, root="", force=False):
self.root = root
if not root:
self.root = os.path.join(os.path.dirname(__file__), "../data")... | 96 | 32.89 | 79 | 18 | 692 | python | [{"finding_id": "codeql_py/tarslip_f97782c6b0e1c0d2_9ef00e1c", "tool_name": "codeql", "rule_id": "py/tarslip", "finding_type": "path-problem", "severity": "medium", "confidence": "medium", "message": "This file extraction depends on a [potentially untrusted source](1).", "remediation": "", "location": {"file_path": "un... | 1 | true | [
"CWE-022"
] | [
"py/tarslip"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
"This file extraction depends on a [potentially untrusted source](1)."
] | [
83
] | [
null
] | [
17
] | [
18
] | |
2024-11-19T02:07:06.829615+00:00 | 1,514,189,573,000 | bce0394fd14abda8ba85c5b15d424fa5c3f7acc8 | 3 | {
"blob_id": "bce0394fd14abda8ba85c5b15d424fa5c3f7acc8",
"branch_name": "refs/heads/master",
"committer_date": 1514189573000,
"content_id": "c2edc69873a6095d0ffb29e265f5fe8cf5896d71",
"detected_licenses": [
"MIT"
],
"directory_id": "9ea53850ba6135ac6f5686c1a38a1029ebccb294",
"extension": "py",
"fi... | 2.515625 | stackv2 | from __future__ import print_function
from __future__ import division
from PIL import Image
import os.path
import numpy as np
import sys
import multiprocessing
from math import ceil
import ctypes
import torch.utils.data as data
from torchvision.datasets.utils import download_url, check_integrity
from multiprocessing im... | 273 | 35.96 | 147 | 19 | 2,539 | python | [{"finding_id": "codeql_py/tarslip_c1ac8a9f762487e5_905caa9b", "tool_name": "codeql", "rule_id": "py/tarslip", "finding_type": "path-problem", "severity": "medium", "confidence": "medium", "message": "This file extraction depends on a [potentially untrusted source](1).", "remediation": "", "location": {"file_path": "un... | 1 | true | [
"CWE-022"
] | [
"py/tarslip"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
"This file extraction depends on a [potentially untrusted source](1)."
] | [
250
] | [
null
] | [
9
] | [
12
] | |
2024-11-19T02:07:06.939939+00:00 | 1,516,214,168,000 | e44aaf390b2962adf6f0d95d4a69c9fde7f7c534 | 3 | {
"blob_id": "e44aaf390b2962adf6f0d95d4a69c9fde7f7c534",
"branch_name": "refs/heads/master",
"committer_date": 1516214168000,
"content_id": "c3a884a426aa3544cece7c7b58cb45a60fce5e2e",
"detected_licenses": [
"MIT"
],
"directory_id": "9580c82325a6ddf57d3f06fa4914c9d66afbd73b",
"extension": "py",
"fi... | 3.375 | stackv2 | '''
Python 2
Writes to three files:
Login
Person
Clients
since they're all connected
Uses 2 instead of 3 because of faker library
'''
import string
import random
from datetime import datetime
from string import split
from faker import Faker
fake = Faker()
def GetFirstName():
nameList = split(fake.name())
... | 203 | 20.76 | 71 | 14 | 1,135 | python | [{"finding_id": "codeql_py/clear-text-storage-sensitive-data_902357cd416100f4_5180ed74", "tool_name": "codeql", "rule_id": "py/clear-text-storage-sensitive-data", "finding_type": "path-problem", "severity": "medium", "confidence": "high", "message": "This expression stores [sensitive data (password)](1) as clear text.\... | 3 | true | [
"CWE-312",
"CWE-312",
"CWE-312"
] | [
"py/clear-text-storage-sensitive-data",
"py/clear-text-storage-sensitive-data",
"py/clear-text-storage-sensitive-data"
] | [
"HIGH",
"HIGH",
"HIGH"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
"This expression stores [sensitive data (password)](1) as clear text.\nThis expression stores [sensitive data (password)](2) as clear text.\nThis expression stores [sensitive data (password)](3) as clear text.\nThis expression stores [sensitive data (password)](4) as clear text.\nThis expression stores [sensitive d... | [
146,
164,
193
] | [
null,
null,
null
] | [
13,
13,
17
] | [
17,
19,
21
] | |
2024-11-19T02:07:14.766647+00:00 | 1,547,083,732,000 | 67f613b48f253fd3042a1ae5b53fd8f727e0db7b | 3 | {
"blob_id": "67f613b48f253fd3042a1ae5b53fd8f727e0db7b",
"branch_name": "refs/heads/master",
"committer_date": 1547083732000,
"content_id": "00256ebcfac8268cc43e1304be66dc0a595cdb34",
"detected_licenses": [
"MIT"
],
"directory_id": "63a9423ae09ed57bd155616b7b73d8d7c1784a8b",
"extension": "py",
"fi... | 2.84375 | stackv2 |
#pylint: disable=C0103,C0111,C0304
from flask import Flask, render_template, jsonify, request
import sqlite3
from get_lyrics import song_lyrics_and_art
from translate_words import get_translate_entry, translate
from fudge_lyrics import fudge
# from get_lyrics import song_id
app = Flask(__name__)
class Song:
de... | 96 | 24.89 | 89 | 15 | 600 | python | [{"finding_id": "codeql_py/sql-injection_b8785e41ef39986a_4332165b", "tool_name": "codeql", "rule_id": "py/sql-injection", "finding_type": "path-problem", "severity": "medium", "confidence": "high", "message": "This SQL query depends on a [user-provided value](1).", "remediation": "", "location": {"file_path": "unknown... | 1 | true | [
"CWE-089"
] | [
"py/sql-injection"
] | [
"HIGH"
] | [
"MEDIUM"
] | [
"This SQL query depends on a [user-provided value](1)."
] | [
50
] | [
56
] | [
29
] | [
12
] | |
2024-11-19T02:31:13.289581+00:00 | 1,601,755,077,000 | 787bcfc3e04b3a68f770a80fe0ca94e12b4613ef | 2 | {
"blob_id": "787bcfc3e04b3a68f770a80fe0ca94e12b4613ef",
"branch_name": "refs/heads/master",
"committer_date": 1601755077000,
"content_id": "e606c927d8f7171daa0fa4755f21e5c1d649095b",
"detected_licenses": [
"MIT"
],
"directory_id": "68e6a31213d2d294f22d35c340fd82d2d2fa438b",
"extension": "py",
"fi... | 2.40625 | stackv2 | # Flask などの必要なライブラリをインポートする
from flask import Flask, render_template, request, redirect, url_for,make_response,jsonify
import numpy as np
import os
from datetime import datetime
import werkzeug
import subprocess
import glob
import json
import hashlib
import random, string
def randomname(n):
randlst = [random.choic... | 107 | 29.66 | 97 | 15 | 872 | python | [{"finding_id": "codeql_py/command-line-injection_24bef67e886d7a5c_c40e3580", "tool_name": "codeql", "rule_id": "py/command-line-injection", "finding_type": "path-problem", "severity": "medium", "confidence": "high", "message": "This command line depends on a [user-provided value](1).", "remediation": "", "location": {... | 4 | true | [
"CWE-078",
"CWE-022",
"CWE-022",
"CWE-022"
] | [
"py/command-line-injection",
"py/path-injection",
"py/path-injection",
"py/path-injection"
] | [
"HIGH",
"HIGH",
"HIGH",
"HIGH"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
"This command line depends on a [user-provided value](1).",
"This path depends on a [user-provided value](1).",
"This path depends on a [user-provided value](1).",
"This path depends on a [user-provided value](1)."
] | [
63,
62,
83,
88
] | [
null,
null,
null,
null
] | [
26,
22,
28,
26
] | [
29,
39,
45,
47
] |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- -