Back to Portfolio
Product security case study

Securing Awade: identity, child data, and AI-generated learning content

An evidence-backed review of an education platform whose friendly experience sits on top of sensitive identity, child-profile, administrative, and model boundaries.

Review: 23 August 2026Scope: authentication, ownership, sessions, AI generation, and PDF exportMethod: source review + focused tests

Security thesis

The interface is not the trust boundary.

Awade helps parents support a child’s learning at home. That makes account identity, child-profile ownership, and generated educational content primary security concerns rather than secondary infrastructure details.

I reviewed the application from the browser through FastAPI, PostgreSQL, Redis, and its OpenAI/Gemini provider layer. Authentication, active-account status, roles, ownership, and model safety are separate controls because each answers a different security question.

Architecture and trust boundaries

01

The React client sends a JWT through an HttpOnly cookie or bearer header; the API—not the browser—authenticates and authorizes the request.

02

FastAPI dependencies verify the token, load the active user, reject suspended accounts, and enforce the exact route audience.

03

Owner-scoped service queries constrain access to child profiles, guides, and exports; administrative access follows a separate elevated path.

04

AI inputs cross sanitisation and delimiter boundaries before provider use; model output crosses JSON, schema, PII, and child-safety validation before persistence.

05

PDF generation is treated as a separate trust boundary because rendering engines can introduce file, network, and unsafe-HTML risks.

Verified controls

Authentication

Fixed-algorithm JWT verification, HttpOnly-cookie support, production fail-closed secret configuration, active-user lookup, and suspended-account rejection.

Authorization

Explicit parent, educator, admin, and super-admin dependencies are combined with owner-scoped child-data queries to prevent cross-account access.

Sessions

Logout blacklists refresh tokens in Redis before deleting authentication cookies; token and cookie behaviour is covered by focused tests.

Account protection

Generic registration and password-reset responses reduce enumeration, while authentication and recovery routes use dedicated request budgets.

AI input

User context is truncated, delimiter tags are removed, sensitive patterns are redacted, injection phrases are scrubbed, and content is placed inside explicit data boundaries.

AI output

Responses are parsed and schema-checked, then screened for PII, jailbreak indicators, and clearly harmful child-facing material before use.

Bounded execution

Provider calls have explicit timeouts and token limits. The model receives no tools or direct write authority; application code controls persistence.

Document export

Authorization, request limits, unsafe-content checks, and focused PDF security tests protect the export boundary.

Threat scenarios

Threat

A parent requests another family’s child profile

The request flows through authenticated parent context and owner-scoped service queries rather than trusting a client-supplied identifier.

Blocked at the ownership boundary

Threat

A standard user calls an administrative route

Administrative routers require an elevated dependency and keep sensitive actions behind explicit role checks and request limits.

Blocked at the API boundary

Threat

User text attempts to override the model instructions

Context is scrubbed, bounded, and placed inside data-only delimiters; suspicious output is independently screened.

Materially reduced through layered gates

Threat

A revoked refresh token is reused

Logout records the token in Redis before clearing cookies, allowing later refresh attempts to be rejected.

Blocked by session revocation

Validation evidence

166

backend authentication, access-control, AI, and PDF security tests passed

16

frontend sanitizer and API-client tests passed

0

new Critical or High findings identified

Clean

secret and sensitive-file checks in the security review

Residual risks and limitations

AI provider key rotation evidence

Open · tracked

Record the last rotation, rotate if the date is unknown or overdue, and maintain a recurring evidence-backed schedule.

AI safeguards remain probabilistic

Continuous risk

Retain layered input/output gates, red-team fixtures, rate limits, model pinning, and human review of educational content.

Child-privacy obligations vary by country

Governance

Review applicable GDPR, COPPA, and local African data-protection requirements before launching in each jurisdiction.

Dependency evolution

Maintenance

Assess breaking SDK and framework upgrades through the dependency-security workflow rather than forcing untested major updates.

This public version excludes secrets, production identifiers, real user data, internal prompt details, and actionable exploit reproduction steps.

View the Awade product case study