-
Notifications
You must be signed in to change notification settings - Fork 0
PR 0eebbd6d758d9c2271a17560120657e3 #147
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
2b95106
aa29c6d
d520c2c
7d10797
9e9d522
6b8c0c1
41c6a2e
2ca097b
94cd1ec
aae1268
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 C20190227040253(): | ||
| "This is an example class" | ||
| a = 10 | ||
| @classmethod | ||
| def funct(self): | ||
| print('Hello Example') | ||
|
|
||
| # Output: 10 | ||
| print(C20190227040253.a) | ||
|
|
||
| # Output: <function MyClass.func at 0x0000000003079BF8> | ||
| print(C20190227040253.func) | ||
|
|
||
| # Output: 'This is my second class' | ||
| print(C20190227040253.__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_20190227040253 import C20190227040253 | ||
|
|
||
| class TestModel01(TestCase): | ||
|
|
||
| def test_01(self): | ||
| x = C20190227040253() | ||
| self.assertIs(x.a,10) | ||
|
|
||
|
|
||
| def test_02(self): | ||
| x = C20190227040253() | ||
| 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.