Risks of using APIs
An API is risky when it lacks authentication, input validation or rate limits, so attackers can send requests straight to it and steal data or misuse it.
Understanding Risks of using APIs in VCE Software Development U4O2
What it does: Returning the whole user object exposes private fields. The API should return only the fields the client actually needs. Checking that id is an integer before using it stops malformed or malicious input from reaching the database. Without authentication the API cannot tell who is asking, so any attacker who finds the endpoint can request data straight from it. Excessive data exposure means an API returns more data than the client needs. Attackers can read the extra data in the response even if the app hides it. Without input validation, an attacker can send malicious input such as SQL injection directly to the API and bypass the app's own interface.
Common mistakes: The condition is reversed, so the profile is returned only when the token is invalid. Valid users are refused and attackers get in. The check should be IF token IS VALID THEN. Resetting the counter means the limit is never enforced, so an attacker can send unlimited requests. When the limit is passed the API should reject the request with RETURN error 429 (too many requests).
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 23–47) and word search (Modules 1–47).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
API security riskFill in the Blanks
Spot the Error
Student with a class code? Join your class →