Skip to content

Commit f694b0c

Browse files
committed
version 1.6.3 - see change log for changes and updates
1 parent e42f0dc commit f694b0c

7 files changed

Lines changed: 78 additions & 20 deletions

File tree

CHANGELOG.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
# Change Log
22

3+
4+
## Version 1.6.3:
5+
6+
🚀 Added
7+
- WASM Test Drive: Updated documentation to highlight the WebAssembly (WASM) version, allowing users to test-drive the tool directly in the browser without local installation.
8+
9+
- Enhanced FileScan API: The filescan API now returns detailed results on found weaknesses, matching the comprehensive output of the CLI version.
10+
11+
🛠️ Changed
12+
- API Refactoring: Extensive refactoring of API functions for better modularity and performance.
13+
14+
- Version Retrieval: Improved the logic for retrieving version information. Special thanks to @jurgenwigg (#PR16).
15+
16+
🐞 Fixed
17+
- Dashboard Reporting: Squashed bugs and improved the reliability of the dashboard reporting APIs.
18+
19+
- Project Metadata: Implemented fixes and improvements for pyproject.toml configuration.
20+
21+
📝 Documentation
22+
- Updated [README.md](https://github.com/nocomplexity/codeaudit/blob/main/README.md) with link to the WASM-based demonstration.
23+
24+
325
## Version 1.6.2:
426

5-
## Changelog
27+
628

729
**Added**
830
* **Automated Python Testing:** Implemented automation for testing across various Python versions to ensure cross-version compatibility.

docs/codeauditcommands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% THIS FILE IS GENERATED! - Use CLIcommands.ipynb to make it better!
22
# Commands Overview
3-
Python Code Audit commands for: version: 1.6.2
3+
Python Code Audit commands for: version: 1.6.3.dev39+ga990bb23a.d20260411
44
```
55
----------------------------------------------------
66
_ __ _

docs/examples/codeauditchecks.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,4 +738,4 @@
738738
<td>Vulnerable to path traversal attacks if used with untrusted archives.</td>
739739
</tr>
740740
</tbody>
741-
</table><br><p>Number of implemented security validations:<b>83</b></p><p>Version of codeaudit: <b>1.6.2</b><p>Because Python and cybersecurity are constantly changing, issue reports <b>SHOULD</b> specify the codeaudit version used.</p><p><b>Disclaimer:</b> <i>This SAST tool <a href="https://github.com/nocomplexity/codeaudit" target="_blank"><b>Python Code Audit</b></a> provides a powerful, automatic security analysis for Python source code. However, it's not a substitute for human review in combination with business knowledge. Undetected vulnerabilities may still exist.</i></p><p>This Python security report was created on: <b>2026-04-10 16:14</b> with <a href="https://github.com/nocomplexity/codeaudit" target="_blank"><b>Python Code Audit</b></a> version <b>1.6.2</b></p><hr><footer><div class="footer-links">Check the <a href="https://nocomplexity.com/documents/codeaudit/intro.html" target="_blank">documentation</a> for help on found issues.<br>Codeaudit is made with <span class="heart">&#10084;</span> by cyber security professionals who advocate for <a href="https://nocomplexity.com/simplify-security/" target="_blank">open simple security solutions</a>.<br><a href="https://nocomplexity.com/documents/codeaudit/CONTRIBUTE.html" target="_blank">Join the community</a> and contribute to make this tool better!</div></footer></div></body></html>
741+
</table><br><p>Number of implemented security validations:<b>83</b></p><p>Version of codeaudit: <b>1.6.3.dev39+ga990bb23a.d20260411</b><p>Because Python and cybersecurity are constantly changing, issue reports <b>SHOULD</b> specify the codeaudit version used.</p><p><b>Disclaimer:</b> <i>This SAST tool <a href="https://github.com/nocomplexity/codeaudit" target="_blank"><b>Python Code Audit</b></a> provides a powerful, automatic security analysis for Python source code. However, it's not a substitute for human review in combination with business knowledge. Undetected vulnerabilities may still exist.</i></p><p>This Python security report was created on: <b>2026-04-20 17:38</b> with <a href="https://github.com/nocomplexity/codeaudit" target="_blank"><b>Python Code Audit</b></a> version <b>1.6.3.dev39+ga990bb23a.d20260411</b></p><hr><footer><div class="footer-links">Check the <a href="https://nocomplexity.com/documents/codeaudit/intro.html" target="_blank">documentation</a> for help on found issues.<br>Codeaudit is made with <span class="heart">&#10084;</span> by cyber security professionals who advocate for <a href="https://nocomplexity.com/simplify-security/" target="_blank">open simple security solutions</a>.<br><a href="https://nocomplexity.com/documents/codeaudit/CONTRIBUTE.html" target="_blank">Join the community</a> and contribute to make this tool better!</div></footer></div></body></html>

docs/examples/demoscan.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Python_Code_Audit",
3-
"version": "1.6.2",
4-
"generated_on": "2026-04-10 16:13",
3+
"version": "1.6.3.dev39+ga990bb23a.d20260411",
4+
"generated_on": "2026-04-20 17:37",
55
"file_security_info": {
66
"0": {
77
"FileName": "demofile.py",

src/codeaudit/dashboard_reports.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
API functions: Used for dashboard reporting (Panel / WASM) and notebooks, or to build custom reports.
1313
"""
1414

15-
# import panel as pn
15+
from codeaudit.api_interfaces import version_info
1616

1717
SAST_REPORT_CSS = """
1818
<style>
@@ -184,11 +184,11 @@ def report_sast_results(scanresult):
184184

185185
# --- Input validation ---
186186
if not scanresult or not isinstance(scanresult, dict):
187-
return '<br><h2">⚠️ No scan result provided</h2>'
187+
return '<br><h2>⚠️ No scan result provided</h2>'
188188

189189
file_security_info = scanresult.get("file_security_info")
190190
if not isinstance(file_security_info, dict) or len(file_security_info) == 0:
191-
return '<br><h2">⚠️ No file security info found</h2>'
191+
return '<br><h2>⚠️ No file security info found</h2>'
192192

193193
# Collect files that have SAST results
194194
files_with_findings = []
@@ -201,7 +201,7 @@ def report_sast_results(scanresult):
201201
files_with_findings.append(file_info)
202202

203203
if not files_with_findings:
204-
return '<br><h2">✅ No security weaknesses found</h2>'
204+
return '<br><h2>✅ No security weaknesses found</h2>'
205205

206206
# --- Safe statistics handling ---
207207
stats = scanresult.get("statistics_overview")
@@ -311,7 +311,7 @@ def report_used_modules(scanresult):
311311
# --- Input validation ---
312312
card1 = ""
313313
if not scanresult or not isinstance(scanresult, dict):
314-
return '<br><h2">⚠️ No scan result provided</h2>'
314+
return '<br><h2>⚠️ No scan result provided</h2>'
315315
modules_discovered = scanresult["module_overview"]
316316
core_modules = modules_discovered["core_modules"]
317317
external_modules = modules_discovered["imported_modules"]
@@ -424,17 +424,23 @@ def get_info_text():
424424
)
425425
return infotext
426426

427-
428427
def get_disclaimer_text():
429428
"""defines the sidebar disclaimer text"""
430429
pn = _require_panel() # Panel module is needed for this function
430+
431+
# Get the version string from version_info
432+
v_info = version_info()
433+
version_id = v_info['version']
434+
431435
disclaimer = (
432-
"<br><b>Disclaimer:</b>This scan only evaluates Python files. "
433-
"Security weaknesses can also exist in other files used by a Python package.<br><br>"
434-
'This SAST tool <a href="https://github.com/nocomplexity/codeaudit" target="_blank">'
435-
"Python Code Audit</a> provides a powerful, automatic security analysis for Python source code. "
436-
"However, it's not a substitute for human review in combination with business knowledge. "
437-
"Undetected vulnerabilities may still exist."
436+
f"<br><b>Disclaimer:</b> This scan only evaluates Python files. "
437+
f"Security weaknesses can also exist in other files used by a Python package.<br><br>"
438+
f'This SAST tool <a href="https://github.com/nocomplexity/codeaudit" target="_blank">'
439+
f"Python Code Audit</a> provides a powerful, automatic security analysis for Python source code. "
440+
f"However, it's not a substitute for human review in combination with business knowledge. "
441+
f"Undetected vulnerabilities may still exist."
442+
f'<p><strong><a href="https://nocomplexity.com/documents/codeaudit/intro.html">Python Code Audit</a></strong> '
443+
f'Dashboard - version {version_id}</p>'
438444
)
439445

440446
disclaimer_text = pn.pane.HTML(disclaimer)

src/dashboard/dashboardapp.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
)
3737
from codeaudit.api_helpers import _codeaudit_directory_scan_wasm
3838

39-
from codeaudit.api_interfaces import get_package_source, version_info
39+
from codeaudit.api_interfaces import get_package_source , version_info
40+
41+
4042

4143
from codeaudit.dashboard_reports import (
4244
create_statistics_overview,
@@ -117,7 +119,7 @@ async def get_package_source_wasm(url):
117119
f.write(content)
118120

119121
with tarfile.open(tar_path, "r:gz") as tar:
120-
tar.extractall(path=temp_dir, filter="data")
122+
tar.extractall(path=temp_dir, filter="data") # nosec Possible risks are mitigated and this happends in the WASM context.
121123

122124
return temp_dir, tmpdir_obj
123125

tests/test_wasmsafe_funtions.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,36 @@ def test_basic_working_scanning():
2323
expected_data = "eval.py" # Assert that the actual data matches the expected data
2424
assert actual_data == expected_data
2525

26+
def test_scan_wasm1():
27+
current_file_directory = Path(__file__).parent
28+
29+
# validation file path
30+
validation_file_path = current_file_directory / "validationfiles" / "zstd.py"
31+
32+
result = _codeaudit_scan_wasm(str(validation_file_path), False)
33+
#Check lines, so the keys:
34+
lines = result['sast_result']
35+
line_numbers = set(lines.keys())
36+
expected_set = {3, 10}
37+
38+
assert line_numbers == expected_set
39+
40+
41+
def test_scan_wasm1_validationscheck():
42+
current_file_directory = Path(__file__).parent
43+
44+
# validation file path
45+
validation_file_path = current_file_directory / "validationfiles" / "zstd.py"
46+
47+
result = _codeaudit_scan_wasm(str(validation_file_path), False)
48+
#Check lines, so the keys:
49+
lines = result['sast_result']
50+
validations = [v["validation"] for v in lines.values()]
51+
expected_set = ['compression.zstd.decompress', 'compression.zstd.open']
52+
53+
assert validations == expected_set
2654

27-
def test_scan_wasm():
55+
def test_scan_wasm2():
2856
current_file_directory = Path(__file__).parent
2957

3058
# validation file path

0 commit comments

Comments
 (0)