Repository navigation
hardening: encode selected items written back into export scripts and confirm forms - #8448
Open
somethingwithproof wants to merge 6 commits into
Open
somethingwithproof wants to merge 6 commits into
somethingwithproof wants to merge 6 commits into
Conversation
somethingwithproof
requested review from
TheWitness
and removed request for
a team
October 22, 2026 21:40
somethingwithproof
added a commit
to somethingwithproof/cacti
that referenced
this pull request
Oct 22, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
added a commit
to somethingwithproof/cacti
that referenced
this pull request
Oct 24, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
force-pushed
the
security/selected-items-js-develop
branch
from
October 24, 2026 06:53
efa0311 to
9b2af08
Compare
github-actions Bot
pushed a commit
to somethingwithproof/cacti
that referenced
this pull request
Oct 26, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
github-actions
Bot
force-pushed
the
security/selected-items-js-develop
branch
from
October 26, 2026 20:50
69b0f2f to
873f2c4
Compare
somethingwithproof
added a commit
to somethingwithproof/cacti
that referenced
this pull request
Nov 2, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
force-pushed
the
security/selected-items-js-develop
branch
from
November 2, 2026 20:10
873f2c4 to
74c6083
Compare
github-actions Bot
pushed a commit
to somethingwithproof/cacti
that referenced
this pull request
Nov 3, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
github-actions
Bot
force-pushed
the
security/selected-items-js-develop
branch
from
November 3, 2026 20:47
74c6083 to
66905b2
Compare
somethingwithproof
added a commit
to somethingwithproof/cacti
that referenced
this pull request
Nov 9, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
force-pushed
the
security/selected-items-js-develop
branch
from
November 9, 2026 08:01
d537281 to
8cd7026
Compare
github-actions Bot
pushed a commit
to somethingwithproof/cacti
that referenced
this pull request
Nov 9, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
github-actions
Bot
force-pushed
the
security/selected-items-js-develop
branch
from
November 9, 2026 20:50
8cd7026 to
c2d9d86
Compare
somethingwithproof
added a commit
to somethingwithproof/cacti
that referenced
this pull request
Nov 12, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
force-pushed
the
security/selected-items-js-develop
branch
from
November 12, 2026 07:51
acfb554 to
457e016
Compare
somethingwithproof
added a commit
to somethingwithproof/cacti
that referenced
this pull request
Nov 17, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
force-pushed
the
security/selected-items-js-develop
branch
from
November 17, 2026 21:43
457e016 to
4e7fe1d
Compare
github-actions Bot
pushed a commit
to somethingwithproof/cacti
that referenced
this pull request
Nov 19, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
github-actions
Bot
force-pushed
the
security/selected-items-js-develop
branch
from
November 19, 2026 20:51
4d5f5fb to
e78efe0
Compare
somethingwithproof
added a commit
to somethingwithproof/cacti
that referenced
this pull request
Nov 25, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
force-pushed
the
security/selected-items-js-develop
branch
from
November 25, 2026 08:04
26359a3 to
ac0d736
Compare
github-actions Bot
pushed a commit
to somethingwithproof/cacti
that referenced
this pull request
Nov 25, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
github-actions
Bot
force-pushed
the
security/selected-items-js-develop
branch
from
November 25, 2026 20:50
ac0d736 to
282e52e
Compare
Build export and download URLs from the validated selection with cacti_url() and cacti_js_encode(), and escape the serialized selection in the confirmation form's hidden input. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Run the real form_actions() export branches and form_continue_confirmation() in probe processes so the request coverage gate measures the changed lines. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The selected items probe was registered only for the request-coverage gate, so changed-coverage saw every changed line as uninstrumented. Register it in run_pr_change_tests.sh, load FixtureCoverage.php in the probe processes and merge their per-process coverage into the runner's report. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The trailing-bytes cases required sanitize_unserialize_selected_items() to accept a value with bytes after the array. That is the decoder's contract, not this change's. Let the export probe report when a page emits no download and require only that the extra bytes never reach the page; a normal selection must still produce the download. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
github-actions
Bot
force-pushed
the
security/selected-items-js-develop
branch
from
November 26, 2026 08:52
282e52e to
a973f77
Compare
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This change makes export and confirmation pages encode selected items for the context where they are displayed. Download links are rebuilt from validated selections and encoded as JavaScript values, and hidden fields receive attribute encoding. This preserves the intended selection while preventing request text from becoming executable page content.
Implementation details
Export and download actions printed the raw selected_items request value into an inline script. They now build the URL from the validated selection with cacti_url() and emit it with cacti_js_encode(). form_continue_confirmation() escapes the serialized selection in its hidden input with html_escape_attr(), so the browser posts back the original value.
sanitize_unserialize_selected_items() is unchanged; every output re-serializes the validated array instead of echoing the request.
Tests: new Pest cases plus request-coverage probes for every export branch and the confirmation form; changed-line coverage 9/9. The new cases fail against the previous page files.
Revision and checks
Description scope: target
develop, 15 changed files, headefa03117a. Checked 2026-10-23 03:06:04 UTC.GitHub check snapshot: 37 passed, 2 failed, 5 skipped, 1 neutral. Checks needing attention:
PHP 8.3 locked integration,CI / required. Local test figures and earlier CI runs above are recorded evidence for their stated revisions and environments; they do not assert that every check passes at this head.Fixes #8881.