assets/js/booking.js and assets/js/group-classes.js inject the policy body from GET /policies into innerHTML unescaped, and PolicyEndpoint::index() (src/Policy/PolicyEndpoint.php) returns the stored body verbatim.
Safety currently rests entirely on wp_kses_post being applied on every write path — which it is today (REST addVersion/updateVersion and the admin PolicyController) — but any future write path that forgets it becomes stored XSS served to every student in the booking/enrolment flow.
The server-rendered registration template already applies wp_kses_post at output (templates/frontend/register-page.php); the REST listing should match.
Fix
Run the body through wp_kses_post() in PolicyEndpoint::index() before returning it. Update the endpoint unit test.
## Finding (security review — Low, defense-in-depth)
`assets/js/booking.js` and `assets/js/group-classes.js` inject the policy `body` from `GET /policies` into `innerHTML` unescaped, and `PolicyEndpoint::index()` (src/Policy/PolicyEndpoint.php) returns the stored body verbatim.
Safety currently rests entirely on `wp_kses_post` being applied on every write path — which it is today (REST `addVersion`/`updateVersion` and the admin `PolicyController`) — but any future write path that forgets it becomes stored XSS served to every student in the booking/enrolment flow.
The server-rendered registration template already applies `wp_kses_post` at output (templates/frontend/register-page.php); the REST listing should match.
## Fix
Run the body through `wp_kses_post()` in `PolicyEndpoint::index()` before returning it. Update the endpoint unit test.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Finding (security review — Low, defense-in-depth)
assets/js/booking.jsandassets/js/group-classes.jsinject the policybodyfromGET /policiesintoinnerHTMLunescaped, andPolicyEndpoint::index()(src/Policy/PolicyEndpoint.php) returns the stored body verbatim.Safety currently rests entirely on
wp_kses_postbeing applied on every write path — which it is today (RESTaddVersion/updateVersionand the adminPolicyController) — but any future write path that forgets it becomes stored XSS served to every student in the booking/enrolment flow.The server-rendered registration template already applies
wp_kses_postat output (templates/frontend/register-page.php); the REST listing should match.Fix
Run the body through
wp_kses_post()inPolicyEndpoint::index()before returning it. Update the endpoint unit test.