Skip to content

Commit

Permalink
small fix to example notebook
Browse files Browse the repository at this point in the history
Summary: ^

Reviewed By: csahana95

Differential Revision: D56311355

fbshipit-source-id: d4bcee0badecafa4762f43557d0ed663ef8de70b
  • Loading branch information
YueLi28 authored and facebook-github-bot committed Apr 18, 2024
1 parent 74b9b09 commit 8a39557
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions CodeShield/notebook/CodeShieldUsageDemo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,9 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"__LLM output after treatment___\n",
"\n",
"def hashString(input):\n",
" return hashlib.md5(input)\n",
"*** Warning: The generated snippit contains insecure code ***\n",
"__Results__\n",
"Security issue detected\n",
"Treatment.WARN\n",
"__Details__\n",
"[Issue(description='Use of weak hashing algorithm', cwe_id='CWE-327', severity=<Severity.WARNING: 'warning'>, rule='\\\\.getMd5Digest\\\\(\\\\)|\\\\.md5\\\\(|\\\\.md5Hex\\\\(|\\\\.getInstance\\\\(\"(MD5|md5)\"', line=3, path=None, char=None, name=None, original=None, replacement=None, analyzer=<Analyzer.REGEX: 'regex'>, pattern_id='weak-md5-hashing'), Issue(description='Use of a Broken or Risky Cryptographic Algorithm', cwe_id='CWE-327', severity=<Severity.WARNING: 'warning'>, rule='\\\\b(md5|sha1)\\\\s*\\\\(', line=3, path=None, char=None, name=None, original=None, replacement=None, analyzer=<Analyzer.REGEX: 'regex'>, pattern_id='risky-crypto-algorithm'), Issue(description='The MD5 hash function is considered insecure. Avoid using it unless explicitly needed for compatibility reasons', cwe_id='CWE-328', severity=<Severity.WARNING: 'warning'>, rule='\\\\bhashlib\\\\.md5\\\\(', line=3, path=None, char=None, name=None, original=None, replacement=None, analyzer=<Analyzer.REGEX: 'regex'>, pattern_id='insecure-md5-hash-usage')]\n"
]
}
],
"outputs": [],
"source": [
"llm_output_code = \"\"\"\n",
"def hashString(input):\n",
Expand Down

0 comments on commit 8a39557

Please sign in to comment.