Ashrafiucse course platform security

From jiayaoqijia/cryptoskill · View interactive version

Ashrafiucse course platform security is an AI agent skill from the GitHub repository jiayaoqijia/cryptoskill. Audits course-selling / e-learning platforms for domain-specific security — catalog gating truth (draft/unpublished/private course exposure to public), preview-vs-full-content leaks, enrollment state machines (free enrollment without paid order), cohort/multi-cohort access control (student of cohort

How to use this skill

Skill file

Course Platform Security

Domain skill built from the three personas. Walk every surface as each

persona — findings live where a persona reaches something that isn't theirs.

1 — Map the domain model

rg -n -i "course|lesson|module|enrollment|cohort|preview|curriculum|subscription" -g '**/models/**' -g '**/entities/**' -g '*.prisma' -g 'schema*' | head -25
rg -n -i "(enroll|purchase|checkout|access|entitle)" -g '*routes*' -g '*controller*' | head -20

Record: course lifecycle states (draft → published → archived? private?),

enrollment sources (order/webhook/admin-grant/subscription), cohort model

(if any), preview mechanism, content storage/signing.

2 — Gating truth (public persona)

The public catalog must only expose what is published AND public.

rg -n "courses?\.(find|where|all|select)" -g '*.js' -g '*.ts' -g '*.py' -g '*.rb'   # census: disposition every read path

(hidden product roadmap + private catalog leaks; PR-sensitive)

status != published) → High — check the 404 branch actually filters status

EVERY read path the public persona can reach, including counts and facets.

3 — Preview vs full content (public persona)

rg -n -i "preview|sample|trial|first.?lesson" -g '*controller*' -g '*routes*' -g '*resolver*' | head

(paid content free; check field selection, not just access)

full content → High (URL guessing/replay)

4 — Enrollment as a state machine (student + flow)

Ties into ../flow-security/SKILL.md (F1/F5 classes) — enrollment is the

terminal artifact of order→payment:

rg -n -i "enrollment.*(create|insert|save)|grant.*access" -g '*.js' -g '*.py' | head

must be separately authorized) → Critical (free enrollment)

body → Critical

(status-guarded) or an admin-grant route with role middleware.

5 — Cohort / multi-cohort access (student persona)

rg -n -i "cohort|batch|class_?id|group_?id" -g '*.js' -g '*.py' -g '*.rb'   # census: disposition every cohort-touching read

cohort scope → High/Critical (cross-cohort read; per-object authz is not

enough — the cohort IS the tenant; see multi-tenant census in ../auth-review/SKILL.md)

enrollment record → Critical

6 — Admin surfaces (admin persona — and everyone else)

rg -n -i "admin|manage|catalog|publish|price|coupon" -g '*routes*' -g '*controller*' | head

Route-census every admin route: course create/update/publish, price change,

coupon mint, refund, user management. Any reachable without role middleware →

Critical (price tamper + free-publish chains). Coupon minting and price

changes are money operations — same state-machine rules as flow-security.

6.5 — Student-authored content inside admin viewports (moderation-queue XSS)

Admin surfaces don't only authorize actions — they RENDER artifacts that

unprivileged users created. For every artifact a student/customer can submit

that staff must open (reviews, support tickets, messages, quiz answers,

assignment text, display names, uploaded file names):

  1. Trace the write path: what validation/sanitization runs before storage?

(required|string alone stores raw HTML.)

  1. Trace the render path in the STAFF surface (moderation list AND detail

view — the detail view is the one staff clicks). Raw echo ({!! !!}),

dangerouslySetInnerHTML, or an iframe/email HTML render of it → Critical:

payload fires in the staff origin, rides the session, escalates to admin

account takeover.

  1. Pending/approval workflows make it worse, not better — they GUARANTEE a

privileged viewer opens the attacker's content.

Tag these student→admin: XSS and cross-reference the framework skill's

raw-output scan (e.g. ../laravel-security/SKILL.md Step 4).

7 — Reporting

Tag findings with the persona that reaches them (public:, student:,

admin:) and the class (GATING / PREVIEW / ENROLLMENT / COHORT / ADMIN).

Chains matter here: unpublished-catalog leak + preview-full-content =

competitor scraping; enrollment-bypass + cohort-IDOR = free full access at

scale. Cite the invariant violated, not just the line.

False-positive discipline

(check the product flag before flagging free-first-lesson)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.