← All projects

CodeAlpha · Secure coding · 2026

Secure Python review

Four risks. One safer rewrite.

Terminal output of a Bandit scan of the demo app: a high-severity finding for a subprocess call with shell=True (CWE-78) at line 30, and run metrics of 3 low, 1 medium and 2 high severity issues across 25 lines of code.
  • Python
  • Bandit
  • Secure coding

The project

Reviewed a local Python demo through manual inspection and Bandit static analysis. Documented hard-coded credentials, weak password hashing, unsafe deserialization, and shell-command injection risks.

How it works

  1. Inspect

    Trace sensitive data and dangerous operations through the demo, then compare the manual review with Bandit.

  2. Harden

    Replace weak hashing and unsafe deserialization, validate input shapes, and constrain command execution.

  3. Explain

    Connect each risk to a concrete fix in the review notes and final report.

What I delivered

  • Produced a hardened Python implementation and a formal review report.
  • Replaced unsafe deserialization with JSON and weak hashing with salted PBKDF2-HMAC-SHA256.
  • Used allow-listed commands, explicit arguments and shell=False.

Project scope

Educational review of a local demo application.

Try the input check

A browser demonstration of JSON parsing and object validation from the Python project.

Write JSON or choose an example.

Use sample data only. This demo checks JSON in your browser; it does not send or store your input. It does not run Python or validate individual fields.