Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        Sign in or join

        Secure coding cheat sheet: OWASP controls

        Match each untrusted value to the operation it reaches. This secure coding reference pairs the control with a bypass and an ordinary request that must keep working.

        Checked 23 November 2026

        Controls and boundaries

        Operation Control Incomplete repair Preserved behavior
        Read a private object Authorize the tenant and object relationship Check only that the user is signed in The permitted owner reads the same record
        Search with SQL Bind values; allowlist structural identifiers Strip a familiar OR payload A legitimate apostrophe still works
        Render text in HTML Encode for the actual output context Encode text, then use it as a URL Ordinary Unicode remains readable
        Accept a cookie-authenticated change Validate a nonempty session-bound request token Compare two missing token values The valid POST succeeds
        Use a signed token Verify signature and required claims Decode or check expiry alone A token for this audience works
        Fetch a supplied destination Parse and restrict destinations; control redirects Test whether a hostname contains a trusted word The approved document still loads
        Select a release artifact Bind approved name, version and digest Trust a version label alone The approved artifact is accepted
        Handle a permission failure Deny without authorization evidence Convert a timeout into an allow Authorized requests recover after the service recovers

        A parameterized query

        const rows = db.query(
          'SELECT id FROM stock WHERE tenant = $1 AND tag = $2',
          [session.tenant, input.tag]
        );

        The tenant comes from trusted authentication context. Binding protects query structure; it doesn’t authorize the caller. A requested column or sort direction needs a mapping to approved SQL fragments rather than a value parameter.

        A repair checklist

        Reproduce the unsafe request. Identify the source and the protected operation. Apply the control where that operation runs. Check a different bypass, a legitimate boundary input and the ordinary feature. Review logs and errors for the data the patch exposes.

        The course supplies checked exercises; independent interviews add changed requirements. Read the threat modeling example before extending the feature. This reference does not replace a threat model, the ASVS requirements that apply to your application or tests against its deployed stack.

        The new lessons and practical interviews in this extension are in English. Earlier translated lessons retain their native versions.

        Sources

        Your Work Gym account

        Save your progress and pick up on another device. Your browser's progress comes with you.

        Your account can start a 5-day free trial: every course, unit, project and exam. Card needed; cancel any time and pay nothing.

        New accounts get 6 hours of full access: every course, unit, project and exam. The clock starts when you go past the free lessons.

        Plan your practice from a job ad or syllabus

        Have a referral code?

        or

        You can keep practicing without an account.

        Help and feedback

        Ask a question, tell us what is not working, or share an idea. We reply by email.

        What is it about?

        We use it only to reply to you.