Category: Security

  • Python Secure Coding Guidelines

    In today’s digital world, security remains a critical concern. This applies equally to Python software. Security breaches that are possible when running untrusted Python programs are real.

    This checklist is intended for anyone who wants to create Python programs that are secure by design.

    Programming in Python is fun, but when you create programs for others, you SHOULD prevent introducing security weaknesses.

    (more…)
  • Avoid a Security Disaster: How to Safely Use Any Python Program

    Python’s dominance as a programming language makes it a prime target for security risks. In today’s digital world, security isn’t guaranteed: a solid architecture helps, but even well-written code—including AI-generated code—is not secure by default.

    The guiding principle for protecting your systems is simple: never trust, always verify (Zero Trust). Since cybersecurity is inherently complex and mistakes are inevitable, proactive verification is an indispensable safeguard.

    (more…)
  • Python SAST: Managing False Positives

    Python is the most widely used programming language worldwide. Its clear syntax, extensive libraries, and adaptability make it suitable for beginners, researchers, and professionals alike. From powering leading websites to driving breakthroughs in artificial intelligence and data science, Python has become a foundational technology across both academia and industry.

    But in today’s digital world, security remains a critical concern. This applies equally to Python software: preventing vulnerabilities starts with a solid architecture, but even well-written code — including AI-generated code — is not secure by default.

    Validating Python code for potential vulnerabilities, using a SAST tool, is therefore essential, whether you are writing your own programs or relying on Python code developed by others.

    Good Python SAST(Static Application Security Testing) tools aim to report all potential code weaknesses. However, not every weakness is a vulnerability that requires immediate remediation.

    Whether a security weakness found by a SAST tool should be fixed is determined by evaluating three factors: Context, Cost, and Program Type.

    • Context: Only humans can properly assess the deployment environment, user base, and business criticality of the application. This human triage is essential for differentiating a benign weakness from an exploitable vulnerability. Therefore, any tool claiming to have zero false positives should be viewed with skepticism, as it likely lacks comprehensive testing.
    • Cost vs Risks: Remediation involves not only the time spent on the security fix but also the resources dedicated to validating functionality and preventing regression.
    • Program Type: The type and potential scope of the code (e.g., a general Python library vs. a specific web service) drastically influences the risk. Code intended for critical environments (healthcare, embedded devices) requires a much lower tolerance for neglecting even minor vulnerabilities.

    Modern Python SAST scanners prioritize comprehensive coverage, flagging all possible code weaknesses for human review. From this perspective, the results aren’t “false positives,” but items requiring contextual assessment.

    The ultimate decision to fix a reported weakness hinges on the program’s execution environment and business criticality. Since only the developer or user holds this complete contextual understanding, the responsibility for final security triage remains human. You are the authority. No AI tool can do your work!

    SAST suppression features carry high security risk because the program’s usage and environment are subject to change.

    For effective security auditing, the decision to ignore or defer a weakness must be transparently documented. The best practice is to place an explanatory comment directly in the code, as this guarantees the human reviewer—who performs the final security triage—will see the rationale in the immediate context of the flagged weakness.

    A simple FOSS tool identify potential security risks in Python programs is Python Code Audit.

    This static application security testing (SAST) tool streamlines and automates key security checks for Python code, helping Python users and developers to detect vulnerabilities early.

  • Python Security: What is SAST

    The rapid growth and increasing complexity of Python based web applications and systems have made robust security testing more important than ever.

    Cybercriminals are constantly evolving their tactics, looking for vulnerabilities they can exploit to steal data or disrupt operations.

    Static Application Security Testing (SAST) is a security methodology that analyzes an application’s source code and related artifacts (such as design documents) without executing the code.

    For Python applications, specific Python SAST tools, like Python Code Audit, perform an in-depth, automated review of the source code to detect security weaknesses and potential vulnerabilities early in the development lifecycle.

    (more…)
  • Python Code Under Fire: Hidden Security Risks

    Python’s popularity and accessibility make it an attractive target for malicious actors. Its widespread presence on developer and server machines means attackers often find it readily available for misuse.

    A key security risk is Python’s ability to easily execute arbitrary code provided as data, which is a common mechanism in various injection and remote code execution (RCE) attacks.

    (more…)
  • Google’s CodeMender: More Dangerous Than Helpful?

    Recently I noticed an interesting new announcement from Google Deepmind called: “Introducing CodeMender: an AI agent for code security“. Since I am into security this article caught my attention.

    A growing trend in the security tooling space is the emergence of AI-powered code auditors — tools that don’t just find vulnerabilities, but claim to fix them automatically.

    (more…)
  • The End of Bandit: Meet Python Code Audit

    The rapid growth and increasing complexity of Python based web applications and systems have made robust security testing more important than ever.

    Cyber criminals are constantly evolving their tactics, looking for vulnerabilities they can exploit to steal data or disrupt operations. Traditional security testing for Python applications is still complex, time-consuming, and expensive. 

    (more…)
  • Code does not lie

    Good measurements for cyber security do not have to be technical. From a defence in depth principle it is recommended to have a mix of various technical and non technical measurements. A healthy distrust in security means never trust software and hardware and take as many measurements to mitigate cyber risks to acceptable levels. 

    (more…)
  • Avoid Python SAST scanners based on AI

    What happened with blockchain technology is also happening with AI technology. Too many people believe that it is a solution for all hard and complex problems. I still love this flowchart that helps you to determine if blockchain is an appropriate technology for your use case. Spoiler: Blockchain is seldom a solution.

    (more…)
  • Stop using assert in your Python code

    Too many Python programs use assert statements to check for conditions, even in widely used modules like Pydantic.


    Using assert can be problematic from a security perspective. The Python assert statement itself isn’t insecure, but its misuse can lead to vulnerabilities.

    (more…)