45 # try-except and contextlib.suppress |
45 # try-except and contextlib.suppress |
46 "S110": QCoreApplication.translate("Security", "Try, Except, Pass detected."), |
46 "S110": QCoreApplication.translate("Security", "Try, Except, Pass detected."), |
47 "S112": QCoreApplication.translate("Security", "Try, Except, Continue detected."), |
47 "S112": QCoreApplication.translate("Security", "Try, Except, Continue detected."), |
48 "S113": QCoreApplication.translate("Security", "'contextlib.suppress()' detected."), |
48 "S113": QCoreApplication.translate("Security", "'contextlib.suppress()' detected."), |
49 # request without timeout |
49 # request without timeout |
50 "S114.1": QCoreApplication.translate("Security", "Requests call without timeout."), |
50 "S114.1": QCoreApplication.translate("Security", "Call to {0} without timeout."), |
51 "S114.2": QCoreApplication.translate( |
51 "S114.2": QCoreApplication.translate( |
52 "Security", |
52 "Security", |
53 "Requests call with timeout set to None.", |
53 "Call to {0} with timeout set to None.", |
54 ), |
54 ), |
55 # flask app |
55 # flask app |
56 "S201": QCoreApplication.translate( |
56 "S201": QCoreApplication.translate( |
57 "Security", |
57 "Security", |
58 "A Flask app appears to be run with debug=True, which exposes the" |
58 "A Flask app appears to be run with debug=True, which exposes the" |
387 # insecure logging.config.listen() |
387 # insecure logging.config.listen() |
388 "S612": QCoreApplication.translate( |
388 "S612": QCoreApplication.translate( |
389 "Security", |
389 "Security", |
390 "Use of insecure logging.config.listen() detected.", |
390 "Use of insecure logging.config.listen() detected.", |
391 ), |
391 ), |
|
392 # Trojan Source |
|
393 "S613": QCoreApplication.translate( |
|
394 "Security", |
|
395 "The Python source file contains bidirectional control characters ({0}).", |
|
396 ), |
|
397 # PyTorch unsafe load or save |
|
398 "S614": QCoreApplication.translate( |
|
399 "Security", "Use of unsafe PyTorch load or save." |
|
400 ), |
392 # Jinja2 templates |
401 # Jinja2 templates |
393 "S701.1": QCoreApplication.translate( |
402 "S701.1": QCoreApplication.translate( |
394 "Security", |
403 "Security", |
395 "Using jinja2 templates with 'autoescape=False' is dangerous and can" |
404 "Using jinja2 templates with 'autoescape=False' is dangerous and can" |
396 " lead to XSS. Use 'autoescape=True' or use the 'select_autoescape'" |
405 " lead to XSS. Use 'autoescape=True' or use the 'select_autoescape'" |
426 _securityMessagesSampleArgs = { |
435 _securityMessagesSampleArgs = { |
427 "S103": ["0o777", "testfile.txt"], |
436 "S103": ["0o777", "testfile.txt"], |
428 "S105": ["password"], |
437 "S105": ["password"], |
429 "S106": ["password"], |
438 "S106": ["password"], |
430 "S107": ["password"], |
439 "S107": ["password"], |
|
440 "S114.1": ["requests"], |
|
441 "S114.2": ["httpx"], |
431 "S202.1": ["members_filter(tar)"], |
442 "S202.1": ["members_filter(tar)"], |
432 "S202.2": ["tar"], |
443 "S202.2": ["tar"], |
433 "S304": ["Crypto.Cipher.DES"], |
444 "S304": ["Crypto.Cipher.DES"], |
434 "S305": ["cryptography.hazmat.primitives.ciphers.modes.ECB"], |
445 "S305": ["cryptography.hazmat.primitives.ciphers.modes.ECB"], |
435 "S313": ["xml.etree.cElementTree.parse"], |
446 "S313": ["xml.etree.cElementTree.parse"], |
452 "S411": ["xmlrpclib"], |
463 "S411": ["xmlrpclib"], |
453 "S412": ["wsgiref.handlers.CGIHandler"], |
464 "S412": ["wsgiref.handlers.CGIHandler"], |
454 "S413": ["Crypto.Cipher"], |
465 "S413": ["Crypto.Cipher"], |
455 "S505": ["RSA", 2048], |
466 "S505": ["RSA", 2048], |
456 "S609": ["os.system"], |
467 "S609": ["os.system"], |
|
468 "S613": [repr("\u202E")], |
457 "S801": ["A1B2C3D4E5F6G7H8I9J0"], # secok |
469 "S801": ["A1B2C3D4E5F6G7H8I9J0"], # secok |
458 "S802": ["aA1bB2cC3dD4/eE5fF6gG7+hH8iI9jJ0=kKlLM+="], # secok |
470 "S802": ["aA1bB2cC3dD4/eE5fF6gG7+hH8iI9jJ0=kKlLM+="], # secok |
459 } |
471 } |