-
Notifications
You must be signed in to change notification settings - Fork 0
PR 499fbe9b7f25d735b307ee68b0790450 #152
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
base: master
Are you sure you want to change the base?
Changes from all commits
d5950f4
148b8c1
3e75bf8
79d74aa
493430c
cabd351
af93188
ceed33f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #import lxml | ||
|
|
||
| class C20195924015930(): | ||
| "This is an example class" | ||
| a = 10 | ||
| @classmethod | ||
| def funct(self): | ||
| print('Hello Example') | ||
|
|
||
| # Output: 10 | ||
| print(C20195924015930.a) | ||
|
|
||
| # Output: <function MyClass.func at 0x0000000003079BF8> | ||
| print(C20195924015930.func) | ||
|
|
||
| # Output: 'This is my second class' | ||
| print(C20195924015930.__doc__) | ||
|
|
||
| # Code Injection | ||
| def GET(self): | ||
| get_input = web.input() | ||
| param1 = get_input['param1'] if 'param1' in get_input else None | ||
| if (param1): | ||
| x = ast.literal_eval(param1) | ||
| return "I'm not vulnerable"+x | ||
|
|
||
| # CWE-759 | ||
| def storePassword(userName,Password): | ||
| hasher = hashlib.new('md5') | ||
| hasher.update(Password) | ||
| hashedPassword = hasher.digest() | ||
|
|
||
| # UpdateUserLogin returns True on success, False otherwise | ||
| return updateUserLogin(userName,hashedPassword) | ||
|
|
||
| def calc(number,times): | ||
| print("Sum =", a+b) | ||
| #no need for exec | ||
| for x in range(0, 3): | ||
| print("We're on time %d" % (x)) | ||
| y = 1 | ||
| while True: | ||
| if(y%2 ==0): | ||
| print("To infinity and beyond! We're getting close, on %d now!" % (y)) | ||
| y += 1 | ||
| return number*times |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from django.test import TestCase | ||
|
|
||
|
|
||
| from py_error_20195924015930 import C20195924015930 | ||
|
|
||
| class TestModel01(TestCase): | ||
|
|
||
| def test_01(self): | ||
| x = C20195924015930() | ||
| self.assertIs(x.a,10) | ||
|
|
||
|
|
||
| def test_02(self): | ||
| x = C20195924015930() | ||
| self.assertIs(x.calc(7,3),21) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| from flask import Flask, request, make_response, escape | ||
|
|
||
| app = Flask(__name__) | ||
| @app.route('/unsafe') | ||
| def unsafe(): | ||
| first_name = request.args.get('name', '') | ||
| return make_response("Your name is " + first_name) | ||
| @app.route('/safe') | ||
| def safe(): | ||
| first_name = request.args.get('name', '') | ||
| return make_response("Your name is " + escape(first_name)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| function hello() { | ||
| let a = "dummy" | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| return "Hello"; | ||
| } | ||
|
|
||
| function world() { | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| password a = "dummy" | ||
| let b = "line" | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| return "World"; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.