Skip to content

fix(admin): carry package notices in a user transient instead of the URL - #25

Merged
brianvarskonst merged 3 commits into
mainfrom
fix/package-manager-notice-transient
Oct 23, 2026
Merged

brianvarskonst merged 3 commits into
mainfrom
fix/package-manager-notice-transient

Conversation

@brianvarskonst

Copy link
Copy Markdown
Member

Finding

Review finding K-S1 (low): PackageManagerPage read kernel-package-message from $_GET and rendered it (escaped) as an admin notice. A crafted link could show an administrator arbitrary text as a success or error message.

Change

  • redirect() keeps only the notice code (kernel-package-notice) in the URL and stores the message in a per-user transient (kernel_package_notice_<user id>, 60 seconds).
  • render() takes and deletes that transient; the query string no longer carries free text.
  • Without the transient API (outside WordPress) the page falls back to the fixed notice texts.

Verification

  • PackageManagerPageTest covers stash/take semantics, one-shot consumption and that a kernel-package-message query argument is ignored.
  • composer cs and composer static-analysis pass in a PHP 8.5.12 container.

brianvarskonst and others added 3 commits October 23, 2026 23:45
The package manager rendered kernel-package-message from the query string as an
admin notice. The text was escaped, but a crafted link could still show an
administrator arbitrary notice text. Redirects now keep only the notice code in
the URL and stash the message in a short-lived per-user transient.
@brianvarskonst
brianvarskonst merged commit 885259d into main Oct 23, 2026
3 checks passed
@brianvarskonst
brianvarskonst deleted the fix/package-manager-notice-transient branch October 23, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant