Skip to content

Python Rules

SAST rules for Python that identify insecure patterns in application code.

Python Rule Catalog

IDTitleSeverityCategory
CODE-0005Insecure Deserialization with msgpack-numpyCRITICALDeserialization
CODE-0179SQL Injection via User-Controlled InputCRITICALInjection
CODE-0180SQL Injection via RawSQLCRITICALInjection
CODE-0216Insecure Deserialization with Pickle in PandasCRITICALDeserialization
CODE-0225Arbitrary Code Execution via NumPy Library LoadingCRITICALInjection
CODE-0247Arbitrary Code Execution via Tensorflow's Load FunctionCRITICALDeserialization
CODE-0252Path Traversal via User-Controlled File PathCRITICALInjection
CODE-0272Avoid importing torch.packageCRITICALDeserialization
CODE-0462Insecure Deserialization with Scikit JoblibCRITICALDeserialization
CODE-0470Arbitrary Code Execution via PyTorch Library LoadingCRITICALInjection
CODE-0489Arbitrary Code Execution via NumPy f2py CompilationCRITICALInjection
CODE-0496Arbitrary Code Execution via Pickle Deserialization in PyTorch DistributedCRITICALDeserialization
CODE-0498Insecure Deserialization in NumPyCRITICALDeserialization
CODE-0515Arbitrary Code Execution via TensorFlow Library LoadingCRITICALInjection
CODE-0756Arbitrary Code Execution via Custom Operator LibrariesCRITICALInjection
CODE-0800Insecure Deserialization in PyTorchCRITICALDeserialization
CODE-0805Arbitrary Code Execution in Keras' load_model FunctionCRITICALDeserialization
CODE-0135Deserialization of untrusted data using cPickleHIGHDeserialization
CODE-0136Deserialization of untrusted data using dillHIGHDeserialization
CODE-0137Deserialization of untrusted dataHIGHDeserialization
CODE-0138Deserialization of untrusted data using pickleHIGHDeserialization
CODE-0139Deserialization of untrusted data using shelveHIGHDeserialization
CODE-0140Insecure Deserialization in YAMLHIGHDeserialization
CODE-0141SQL Injection via Improper Neutralization of Special ElementsHIGHInjection
CODE-0144Eval InjectionHIGHInjection
CODE-0145OS Command Injection via exec FunctionHIGHInjection
CODE-0146Improper Neutralization of Wildcards or Matching SymbolsHIGHInjection
CODE-0147OS Command InjectionHIGHInjection
CODE-0148OS Command InjectionHIGHInjection
CODE-0149OS Command InjectionHIGHInjection
CODE-0150OS Command InjectionHIGHInjection
CODE-0151OS Command InjectionHIGHInjection
CODE-0152OS Command InjectionHIGHInjection
CODE-0157Improper control of generation of code ('Code Injection')HIGHInjection
CODE-0162SQL InjectionHIGHInjection
CODE-0266OS Command Execution with Partial PathsHIGHInjection
CODE-0267Subprocess with Non-Absolute PathsHIGHInjection
CODE-0268Subprocess call with untrusted argumentHIGHInjection
CODE-0282Potential Code Injection via Pandas eval() or query()HIGHInjection
CODE-0516Path Traversal in Tarfile ExtractionHIGHInjection
CODE-0757XXE Attack via lxml in PandasHIGHInjection
CODE-0809SQL Injection from User-Controlled Query StringHIGHInjection
CODE-0114Use of a broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0115Use of Broken or Risky Cryptographic AlgorithmMEDIUMCrypto
CODE-0116Use of broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0117Use of broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0118Use of broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0119Use of a broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0120Inadequate encryption strengthMEDIUMCrypto
CODE-0121Inadequate encryption strengthMEDIUMCrypto
CODE-0122Use of a broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0123Use of a broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0124Use of broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0125Use of Broken or Risky Cryptographic AlgorithmMEDIUMCrypto
CODE-0126Use of a Broken or Risky Cryptographic AlgorithmMEDIUMCrypto
CODE-0127Use of a broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0128Use of a broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0129Use of a broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0130Use of a broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0131Use of a broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0132Use of a broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0133Use of a broken or risky cryptographic algorithmMEDIUMCrypto
CODE-0134Use of deprecated pycrypto packageMEDIUMCrypto
CODE-0142Jinja2 Template Engine Without Autoescaping EnabledMEDIUMInjection
CODE-0143Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')MEDIUMWeb
CODE-0153Incorrect permission assignment for critical resourceMEDIUMAccessControl
CODE-0154Path Traversal Vulnerability in Tar File ExtractionMEDIUMInjection
CODE-0155Flask Application Running with Debug Mode EnabledMEDIUMInsecureConfig
CODE-0156Insecure XML Parsing with lxmlMEDIUMInjection
CODE-0159Insecure Request TimeoutMEDIUMInsecureConfig
CODE-0160Insecure SNMP version usedMEDIUMInsecureConfig
CODE-0161SNMPv3 without authentication or encryptionMEDIUMCrypto
CODE-0163Key exchange without entity authenticationMEDIUMAuth
CODE-0164Improper Certificate ValidationMEDIUMWeb
CODE-0165Inadequate encryption strengthMEDIUMCrypto
CODE-0166Inadequate Encryption StrengthMEDIUMCrypto
CODE-0167Unverified SSL ContextMEDIUMCrypto
CODE-0168Cleartext transmission of sensitive informationMEDIUMInsecureConfig
CODE-0169Insecure temporary fileMEDIUMInsecureConfig
CODE-0170Insecure Temporary File CreationMEDIUMInsecureConfig
CODE-0171Improper Authorization in Handler for Custom URL SchemeMEDIUMInjection
CODE-0172Improper Restriction of XML External Entity ReferenceMEDIUMInjection
CODE-0173Improper Restriction of XML External Entity ReferenceMEDIUMInjection
CODE-0174Improper Restriction of XML External Entity ReferenceMEDIUMInjection
CODE-0175Improper Restriction of XML External Entity ReferenceMEDIUMInjection
CODE-0176Improper Restriction of XML External Entity ReferenceMEDIUMInjection
CODE-0177Improper Restriction of XML External Entity ReferenceMEDIUMInjection
CODE-0178Improper Restriction of XML External Entity ReferenceMEDIUMInjection
CODE-0249Insecure Random Number Generation in PyTorch DatasetMEDIUMInsecureConfig
CODE-0253Unvalidated RedirectMEDIUMWeb
CODE-0260PyTorch Distributed Request Without WaitingMEDIUMGeneric
CODE-0509Cleartext communication over HTTPMEDIUMInsecureConfig
CODE-0510JWT using insecure 'none' algorithmMEDIUMCrypto
CODE-0758Avoid using NumPy inside PyTorch modulesMEDIUMPerformance
CODE-0810CSRF origin check disabled in Pyramid configMEDIUMWeb
CODE-0814Cross-Site Scripting (XSS) via Improper Neutralization of InputMEDIUMWeb
CODE-0103Inefficient Tensor CreationLOWPerformance
CODE-0112Improper use of assert statementLOWErrorHandling
CODE-0113Binding to an unrestricted IP addressLOWInsecureConfig
CODE-0158Use of cryptographically weak pseudo-random number generator (PRNG)LOWCrypto
CODE-0219Use of deprecated numpy.distutilsLOWInsecureConfig
CODE-0640PyTorch Memory Not Automatically PinnedLOWInsecureConfig

Total Rules: 102

Click on any rule ID to view detailed information, examples, and remediation guidance.