Skip to content
Ho Dinh Tri
Writing

Article

Mapping the OWASP API Top 10 to a Real Project: Access Control in SmartATS

An applicant tracking system is a directory of personal data behind an API. Three OWASP API risks shaped how SmartATS decides who may see what.

3 min read

The worst bug I fixed in SmartATS didn't need any cleverness to exploit. Request /api/v1/candidates/{id}/cv with a candidate's ID and you got their CV, no login required. That one endpoint is a textbook example of the first risk on the OWASP API Security Top 10, and a good way into the rest of the list.

Why an ATS is a security problem#

An applicant tracking system stores CVs: names, phone numbers, emails, work histories. Behind the interface, it is an API that hands that data to whoever asks correctly. SmartATS, built by four of us for a software engineering course, has 54 REST APIs across 10 modules, so most of the security work came down to one question: who may ask for what?

The OWASP API Security Top 10 (2023) is a good checklist for that, because three of its risks map directly onto the ways an ATS leaks data.

API1: Broken Object Level Authorization#

The risk: an endpoint checks that you're logged in, but not that this record is one you may see. Change the ID, read someone else's data; repeat, and you've copied the database.

How it happened to us: the CV endpoint wasn't just missing an object check, it was missing authentication entirely. The reason was mundane: the interface opened CVs with window.open, and a browser navigation can't send an authorization header. The endpoint was left open so the button would work.

The fix (my part): the endpoint now requires a token and returns JSON with a short-lived link instead of the file. The interface fetches that JSON with the user's token, then opens the link. Signed links to Azure Blob Storage now expire after 15 minutes instead of 60.

The object check: a shared function decides whether a user may access a candidate by looking at the candidate's job posting: the HR user must have created it, or the reviewer must have been invited to its panel. Unknown roles are refused, and a refusal looks like "not found", so the response doesn't confirm the candidate exists. The check runs on the review, enrichment, live-update and CV routes.

API3: Broken Object Property Level Authorization#

The risk: the caller may see the record, but not every field on it. If the server returns everything and the interface hides some fields, anyone reading the raw response sees them.

What SmartATS does: technical reviewers get a default-deny allow-list of fields; everything else is replaced with *** on the server, recursively. The personal data never enters their network response.

API5: Broken Function Level Authorization#

The risk: admin functions that ordinary users can call, because the check lives in the interface rather than the API.

What SmartATS does: the whole admin router requires the admin role, with extra checks on individual routes. A recruiter calling an admin endpoint directly is refused.

Rules belong on the server too#

The same idea applies beyond access control. A candidate advances when 80% of the review panel approves. The backend computes how many approvals that means and returns it; the browser only displays it, so a modified client can't argue for a different answer.

Reality check#

  • Access control was a team design. My part was the CV path, plus parts of the review-panel scoping.

Takeaways#

  • Missing authentication often hides behind a UI constraint. "The button can't send a header" is a reason to change the button, not to open the endpoint.
  • Write the regression test as an attacker. The next step for a system like this is an automated suite that logs in as one user and tries to read every other user's records.

Short note2 min read

How I Read AI Security Papers as a Student

A reproduction that landed eight points below the paper taught me to read results before explanations, and to treat every number as a measurement under conditions.

AI SecurityLearning Notes
Back to Writing