Job search
Application Security Portfolio: Connect a Threat Model, a Code Finding, and a Verified Fix
Build a traceable application-security sample with an original threat model, a code finding, an executed fix, and an explicit residual-risk record.
An application security portfolio is easier to assess when one claim can be traced from a design assumption to a specific code defect, a small repair, and tests that distinguish the two versions. Start with an application you own or are explicitly authorized to test. Make the evidence small enough for a reviewer to reproduce without credentials or access to someone else’s system.
This guide uses two original, synthetic Python examples executed locally on October 23, 2026: a note-reading authorization defect and a separate logging-data exposure. Neither is a deployed application or a discovery in a real product. The useful deliverable is a bounded engineering argument, with both successful checks and remaining uncertainty visible.

Look at LandOffer’s recently posted jobs for the code-review, design-review, or remediation responsibilities you want to demonstrate. Build the sample around one of those responsibilities and describe your actual contribution precisely.
Choose a claim the repository can support
A portfolio can show that you identified a missing permission check in your own program and verified a specific correction. It cannot establish production experience, vulnerability severity in an unknown deployment, or comprehensive application security merely by including a familiar vulnerability label.
Keep the exercise different from a SOC investigation. Here, the primary evidence is source code, a stated access policy, and executable regression assertions. A log-investigation portfolio asks what recorded events support about an incident. Even the second logging example below concerns preventing unnecessary data from entering a record; it does not attribute an attack or investigate real users.
The current OWASP practical threat-modeling guide connects system descriptions and assumptions with threats, remediation, and ways to check whether the action worked. That gives the project a useful organizing principle. A diagram should name the boundary being crossed and the decision made there. In this project, the useful connection is the requested record, its stored owner, and the function that decides whether to return it.
Write the intended claim before building the example: “A user may read only their own private note; the local function must reject another owner’s note and an absent actor.” This is concrete enough to challenge. Avoid “make the app secure,” which supplies neither an acceptance condition nor a meaningful stopping point.
Worked asset one: a completed note-read threat model
The original teaching application has two records. note-A belongs to usr-A and contains “Demo A”; note-B belongs to usr-B and contains “Demo B.” These invented labels and bodies carry no personal or customer information. The only operation is reading a note by its identifier.
The completed model, TM-N1, has these boundaries:
- Protected asset: the confidentiality of each note body relative to the other user.
- Actor: an authenticated principal supplied by a trusted caller. The fixture substitutes fixed strings; it does not implement authentication.
- Untrusted choice: the requested note identifier. Knowing an identifier does not grant permission.
- Flow: caller →
read_note(actor_id, note_id)→ in-memory note dictionary → permitted body orNone. - Threat: a caller requests a record belonging to another actor and receives its body because the function never evaluates ownership.
- Required mitigation: return the body only when the actor exists and matches the stored owner; otherwise return
None. - Verification: run the same six declared cases against both source versions, preserving legitimate owner reads as well as denials.
The trust assumption matters. If a future Web handler copies actor_id from a user-controlled field, this ownership comparison could still be bypassed through impersonation. The sample’s caller must obtain identity from a real, verified authentication context. That integration remains outside the experiment.
The vulnerable source is deliberately tiny. It looks up the note and returns its body whenever the record exists; the actor parameter is ignored. The completed finding AUTH-N1 names before.py, line 9: the body-return statement executes without evaluating the supplied actor. It links that omission to TM-N1’s owner-only rule and the two cross-owner denial cases. It is a source-level finding in an authored toy, not a report against a third-party service.
OWASP’s object-level authorization guidance explains why access to a function or possession of an object identifier does not establish permission for that object. Its broader API discussion provides context; this fixture has no HTTP endpoint. We use the concept to explain the missing decision, without claiming an API was tested.
Verify the fix against both allowed and denied behavior
The repaired function checks for an absent actor or missing note, then compares the stored owner with the trusted actor. The body is returned only after those conditions are satisfied. The essential decision is short:
if not actor_id or not note:
return None
if note["owner"] != actor_id:
return None
return note["body"]
This is the policy for this two-owner teaching model. A real application with delegated access, organization roles, shared documents, or administrator privileges would need a policy that represents those relationships. Do not paste this equality test into a richer system and assume it covers every permission.
The actual local regression produced:
| Case | Required result | Before | After |
|---|---|---|---|
| usr-A reads note-A | Demo A | Pass | Pass |
| usr-B reads note-B | Demo B | Pass | Pass |
| usr-A reads note-B | None | Fail | Pass |
| usr-B reads note-A | None | Fail | Pass |
| Absent actor reads note-A | None | Fail | Pass |
| usr-A requests a missing note | None | Pass | Pass |
That is three of six authorization assertions passing before the change and six of six afterward. The test runner asserts those counts, but the more important evidence is the saved row for each input, expected result, and actual result. The negative cases expose the defect, while the two owner cases preserve the feature users are meant to have. A reviewer can therefore check both the confidentiality rule and the legitimate read behavior in one small run. A green result would be much less informative if the tests checked only valid reads.
OWASP’s authorization cheat sheet recommends denying by default, checking permissions consistently, and testing authorization logic. It also distinguishes these tests from broader security testing. Here, the verified statement is limited to the six local cases; it is not a penetration-test result or evidence that every future access path is protected.
The supplied demo directory contains before.py, after.py, fix.diff, and regression.py, plus the saved result and replay. From that directory, run:
python3 regression.py > replay.json
The receipt records the actual Python version, platform, source hashes, and per-case expected and observed values. Two separate local executions produced byte-identical output. No dependencies were installed, no network request was made by the fixture, and no external application was scanned. Another Python environment has not been independently validated by this exercise.
Record residual risk before calling the finding closed
The completed disposition for AUTH-N1 is corrected within the tested local function. It remains conditional on trusted caller identity and the stated owner-only read policy. Returning None for missing and unauthorized records is a fixture convention; no HTTP status code, response body, or timing behavior was tested.
The residual-risk record assigns authentication and session integration to a future application owner, database permission enforcement to a future persistence review, and additional read/update/delete routes to a future authorization inventory. Those are proposed follow-up reviews, not controls already implemented here. The dictionary has no concurrency, tenant hierarchy, revocation, or database query behavior.
This closure statement should be explicit. “Fixed object authorization for the six declared local cases” is supported. “Eliminated broken access control across the application” would exceed the evidence. A reviewer should be able to disagree with an assumption without having to discard the entire project.
Keep source identity stable while presenting the case. If you improve the implementation after writing the report, rerun the checks and update the recorded hashes. Otherwise, the visible patch and the saved green output might describe different programs. A hash identifies a file revision; it does not independently prove that the file was tested correctly.
Worked asset two: a separate logging review packet
A second original case, LOG-R2, uses a different operation and dataset. An invented export-denial event contains event_type, request_id, and outcome, plus an explicitly fake API-token string and an invented private note body. No real secret or user activity is included.
The before-version’s event_record function copies the whole event dictionary into its returned record. The fixture does not write to a log file or collector; the verified boundary is the record-building function’s output. The review finding is that the output includes fields the operational record does not need. The repair constructs a new record from an allowlist of three fields: event type, request identifier, and outcome. It does not attempt to recognize every possible secret by its spelling.
The completed reviewer packet records four assertions:
- The
api_tokenfield is absent from the output. - The
note_bodyfield is absent from the output. - All three required operational values remain intact.
- The output keys equal the declared three-field schema, excluding unapproved additions.
The before-version passes only the operational-values assertion: one of four. The repaired version passes four of four. These are executed assertions over an original local record, not results from a production logging service. Both the fake token and private-body fields are visible in the synthetic input so a reviewer can inspect exactly what changed.
The OWASP logging cheat sheet identifies tokens and other sensitive material as data that generally needs exclusion or appropriate protection, and includes logging in verification work. Our chosen allowlist is a design decision for this toy schema, not a claim that every application needs these exact three fields.
The packet’s residual-risk decision is equally specific: schema filtering passed; free-form field contents, log injection, storage access, retention, transport, and logger failure remain untested. A token embedded inside request_id would not be removed merely because the key is allowed. The next proposed review would define field formats and permitted contents, then test the actual logging destination and its access controls. None of those checks was performed in this local demonstration.

Give the reviewer a short, reproducible route
Package each finding with its policy, source location, patch, repeat command, result, and remaining questions. Open with the bounded outcome so the reader knows what the project demonstrates. Put the full source beside the report rather than offering only screenshots of green tests.
For this project, the first review route is TM-N1 → AUTH-N1 → owner-check patch → six-case result → residual-risk record. The independent route is LOG-R2 → event-schema decision → allowlist patch → four-assertion result → content and storage exclusions. A reviewer can follow either route without relying on the other case’s conclusion.
A defensible portfolio summary is: “Authored two synthetic Python security-review examples; traced an owner-only note-read policy into a code fix and six-case regression, and verified a separate logging-field allowlist while documenting integration gaps.” It reports what was built and checked. It does not suggest a real customer vulnerability, a production deployment, or a security certification.
When discussing the project, explain one rejected shortcut: denying every note read would satisfy denial tests while breaking legitimate access. Then identify one remaining assumption you would test next, such as authenticated identity propagation. That combination makes your reasoning reviewable without inventing business impact or employer endorsement.
Use LandOffer’s current listings to select relevant responsibilities, then decide which original sample files explain your work. The job-search tool does not validate this security project or replace an employer’s technical review. Keep the verified fix and its limits together wherever the project appears.
Download the worked example files
Download the curated educational companion. Read PUBLICATION-README.md after extraction for the public file layout, replay commands and requirements. The listed offline Python checks were rerun from the extracted archive in a disposable directory. The earlier local report and commands describe the original evidence environment; use the companion README for the portable layout. No whole evidence directory, credentials or compiler binaries are included.


