Sources indicate that ticketee is a well-built ASP.NET Core app. It uses ASP.NET Core Identity with account lockout and rate limiting, antiforgery tokens on every form, EF Core queries that are always parameterized, Markdown rendering with raw HTML disabled and a sanitizer, a safe login redirect, and a project-membership check on every project route.

Even so, any registered user can read every issue in every private project on the instance. All it takes is the Open selected filter on their own project's issue list.

This post walks through the full review: how the app works, where user input comes in, which defenses hold, which one is missing, a working exploit, and the fix. Every code snippet you need is included, so you don't have to open the repo to follow along. Each snippet links to its exact lines on GitHub if you want more context.

Sources indicate that 🎥 Prefer video? The full walkthrough is on YouTube:.

It's a free, biweekly series. Each challenge is a complete, realistic application with its own database, backend and UI, and one vulnerability planted on purpose, based on a real-world CVE or writeup. You review it the way you'd review a real codebase, then compare your reasoning with the published solution.

Every solution follows the same 7-step methodology:.

📌 Repo: https://github.com/mohamed-osama-aboelkheir/the-secure-code-review-challenge 📌 Challenge #10 source: https://github.com/mohamed-osama-aboelkheir/the-secure-code-review-challenge/tree/main/challenges/010-ticketee.

⚠️ Spoiler warning: if you want to try Ticketee yourself first, stop here and come back later.

Ticketee is a small Jira-style problem tracker. Owners register, create projects, invite teammates, and track problems on a board. Issues have human-friendly keys like APOL-001 and Markdown descriptions.

The whole review comes down to one promise: a project's challenges are visible only to that project's lead and members.

docker-compose.yml starts two containers: a stock postgres:16 and the app. The app's Dockerfile is the typical two-stage .NET build: dotnet publish compiles everything into Ticketee.dll, and the runtime image runs it as a non-root user:.

The program starts at the top of Program.cs. If you're coming from Spring (Challenge #9), here's the big difference: ASP.NET Core doesn't scan for your own classes. Everything the app uses is registered explicitly, by name, in Program.cs. So you read it top to bottom: first the builder.Services.Add… calls (what exists), then the app.Use… calls (what runs on every request, in order).

The registrations show the app's architecture: a database context, three stores (database access), three services (business rules) and a Markdown renderer:.

Sources indicate that nobody calls latest IssueService(...). ASP.NET Core's dependency injection container builds each class when something asks for it. That's how the layers connect: controller or page → service → store → database.

Then come the API controllers, the Razor Pages (with every page under /Projects requiring a login), and the built-in CSRF protection, which Ticketee calls AddAntiforgery:.

In a recent development, finally, the middleware pipeline. Every request passes through these steps in the order they're written: a generic error handler, security headers (including a CSP), routing, the rate limiter, authentication, authorization, and then the controller or page:.

Industry observers note that the register page (POST /register) and its API twin (POST /api/auth/register) call the same AuthService.RegisterAsync, which trims and lower-cases the email, checks lengths, and hands the user to Identity's UserManager.CreateAsync. That method hashes the password (salted PBKDF2) and saves the user. The app never writes its own hashing code.

Login uses ValidateCredentialsAsync. An unknown email still pays for one hash check, so timing doesn't reveal which emails exist, and the password check counts failures toward lockout:.

Any logged-in user can create a project. The project's key comes from the first four letters of its name, so "Apollo Mission" becomes APOL:.

The store saves the project with the creator as lead and as a member, in one write.

Only the lead can invite someone. The invitation code is 16 random bytes from a cryptographically secure generator:.

The teammate pastes the code on the Join a project page. The code must exist, must not have been used before, and must have been issued to their email.

Industry observers note that every project-scoped route, in the API and the UI, starts with the same gatekeeper. It loads the project by the key in the URL and checks that the caller is its lead or a member:.

Problems get keys made of the project key plus a counter: APOL-001, APOL-002, and so on.

Opening one issue (GET /api/projects/{key}/concerns/{issueKey}) runs RequireAccessAsync and then IssueService.GetAsync, which loads the issue and checks that it belongs to the project in the URL:.

In a recent development, listing issues (GET /api/projects/{key}/issues, and the Issues tab in the UI) has an extra feature. You can tick a few issues and click Open selected, which reloads the page with ?issueKeys=APOL-001&issueKeys=APOL-004 and highlights only those issues, with their full descriptions:.

Recent findings suggest that listAsync has two branches: with issueKeys it loads the selected challenges, and without it loads the whole project's list. Keep those two branches in mind.

There are two kinds of IDs in every matter URL:.

The project is a parent, and each issue is a child with its own ID. Authorizing the parent doesn't automatically authorize every child the request names. Every route that takes an issue key must also check that the issue belongs to the authorized project.

Each action has two doors, an API route and a UI route, and both call the same service:.

According to recent reports, loading an object by a user-supplied key isn't a sink. It's an authorization question, so it belongs to the business-logic part of the threat model.

It has been revealed that authentication ✅. Apart from register and login, every route requires a user: [Authorize] on the API controllers and AuthorizeFolder("/Projects") on the pages. Without a valid token the API answers 401, and the UI redirects to /login. On top of that, the framework gives Ticketee lockout after 5 failures for 15 minutes, and a rate limiter allows 20 auth POSTs per IP per minute:.

Auth.cs#L29-L31 · rate limiter, Program.cs#L32-L40.

Invitations (function-level authorization) ✅. Only the lead can invite (project.LeadId != userId → 403), and only the invited email can accept:.

Recent findings suggest that project access (object-level authorization) ✅. RequireAccessAsync runs on every project route, and HasAccessAsync checks lead or member in one query:.

Recent findings suggest that mass assignment ✅. Could you set projectId in a create or patch body and move an matter into someone else's project? No. PATCH starts from an empty update and reads six named fields from the JSON, nothing else:.

Create binds to a narrow CreateIssueRequest record, which has no ProjectId property to fill.

Sources indicate that S1, SQL injection ✅. There's no SQL text anywhere in Stores.cs. Every query is LINQ (Where, OrderBy, Select, …), and EF Core turns it into a parameterized query. The only EF Core APIs that need care are the raw-SQL ones like FromSqlRaw (EF Core docs), and the code doesn't use any of them. In the Postgres log, the issue-key list arrives as a bound array:.

In a recent development, S2, XSS through Markdown ✅. The renderer has two layers. Markdig's DisableHtml() treats raw HTML in the Markdown as plain text, and then HtmlSanitizer keeps only allow-listed tags and the http, https and mailto URL schemes:.

Recent findings suggest that S3, XSS through Razor ✅. Razor HTML-encodes every @ expression by default, so < becomes <. You only lose that protection with explicit escape hatches like Html.Raw, and the code doesn't use any. The CSP (script-src 'self') is a backup layer.

S4, open redirect ✅. After login, the app only follows ReturnUrl if it's a local path. Otherwise it goes to /projects:.

We've checked access to the project. But concerns are separate objects with their own IDs, so they need their own check.

Single concern (view, edit, move) ✅. As we saw in Story 4, GetAsync compares issue.ProjectId with the authorized project. If you're a member of project A and ask for project B's issue through A's URL, you get 404. If you ask through B's URL, you get 403. UpdateAsync takes the same path.

The issue list with issueKeys ❌. ListAsync receives the authorized project, but only the no-filter branch uses it:.

It has been revealed that look at the store. ListByProjectAsync filters on ProjectId. FindByKeysAsync, right above it, filters on the key only:.

Sources indicate that so the authorization check answers "may this user see project X?", where X is the key in the URL. The query answers a different question: "which challenges have these keys?" Nothing connects the two. An attacker can pass the first check with their own project and use the second to pull anyone's issues.

In a recent development, 💡 Reviewer's lesson: IDOR isn't about one ID. When a request carries more than one identifier (a parent in the path, children in the query string or body), check every one of them against what the caller is allowed to see. Ticketee did it right for the project key, and for the concern key on single-issue routes, and missed it in the one branch that loads several problems at once.

Sources indicate that the project key in the path has to be one the attacker can access, so it's their own project. The victim's IDs go in the one place nobody checks: the issueKeys filter.

Recent findings suggest that two victims each have a private project: Alice has "Secret Roadmap" (SECR) and Bob has "Payroll Migration" (PAYR). The attacker, Mallory, registers and creates a throwaway project, "Cover" (COVE):.

Control: the normal routes block Mallory.

Payload: ask Mallory's own project's list for Alice's keys.

According to recent reports, it works in the browser too. Opening Alice's project directly gives the 403 page:.

But opening /projects/COVE/problems?issueKeys=SECR-001,SECR-002,SECR-003,PAYR-001,PAYR-002 indicates Alice's and Bob's issues, with their full Markdown descriptions, inside Mallory's own project page:.

In a recent development, the keys are easy to guess. A project key is four letters, and glitch numbers count up from 001. Plus, one request takes up to 100 keys. So a short script can test XXXX-001 for every four-letter key (26⁴ = 456,976) in about 4,570 requests, then pull challenges 001–100 from each project it finds:.

Industry observers note that impact: any registered user can read the title, full description, type, priority, status, assignee and reporter of every issue in every private project on the instance. They don't need to know any project name, and the victims don't have to do anything. It's read-only, because writes go through GetAsync and stay scoped.

Classification: Insecure Direct Object Reference / Broken Object Level Authorization, CWE-639: Authorization Bypass Through User-Controlled Key, OWASP API1:2023. It isn't SQL injection: the query is parameterized and safe, it's just missing a condition.

Primary fix: scope the query to the authorized project, in the store. Make the project a required argument, so this caller (and any future one) can't forget the filter:.

With the fix, the same request returns only Mallory's own concern, and the dump script finds nothing:.

Defense-in-depth (do these too):.

It has been revealed that IDOR isn't a check you do once per request. It's a check you do for every ID the request carries. Ticketee checked the project key in the URL and forgot about the issue keys in the query string. Checking access to the container isn't the same as checking every object you return.

Watch for bulk, batch, "open selected" and export features in particular, because they bring their own list of IDs. The query that loads those IDs must be scoped to the parent the caller was authorized for. The safest place to enforce that is the data layer, where no caller can forget it.

In a recent development, challenge #11: RepoSync is live now. It's a small self-hosted Git server, a minimal GitHub. Can you find the bug before the solution drops?

👉 https://github.com/mohamed-osama-aboelkheir/the-secure-code-review-challenge/tree/main/challenges/011-reposync.

If you found the bug yourself, or took a different route to it, tell me in the comments 👇.

📌 Read also:

→ Read original article