Repository navigation
Protect the chart meta keys - #1424
Open
vytisbulkevicius wants to merge 1 commit into
Open
vytisbulkevicius wants to merge 1 commit into
vytisbulkevicius wants to merge 1 commit into
Conversation
Chart meta selects the data source of a chart. Mark the keys as protected, so that only the plugin writes them, and refuse file access in a stored query. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Contributor
pirate-bot
approved these changes
Nov 27, 2026
Contributor
There was a problem hiding this comment.
🟢 Approved
This approves the change: chart meta keys are protected on every core meta route, and the database source refuses the three file statements.
Validation details
- Files reviewed: 3/3 changed files.
- The new PHPUnit file passed at HEAD on PHP 8.3.37 and WordPress 7.1.5
cd /repo && (phpunit --do-not-cache-result --filter 'Test_Visualizer_Chart_Meta_Protection::' --testdox 2>&1 | tee /work…(run R6, exit 0). - All 10 cases failed with the
pr-baseversions ofSetup.phpandQuery.phpset -o pipefail; B=/workspace/checks/C1/base; rm -rf $B; mkdir -p $B && git -C /repo archive HEAD | tar -x -C $B && cp -…(run R3, exit 0). INTO#cplus newlineOUTFILEandINTO -- cplus newlineDUMPFILEwere refusedcd /workspace/checks/C1/probe && mv probe-c1.php Probe_C1.php && cd /repo && (phpunit --do-not-cache-result --bootstrap …(run R5, exit 2).- Every core caller of
is_protected_meta()passes'post'in WordPress 5.2 and 7.1. - Every
CF_*chart meta key starts withvisualizer-.
Untested areas
- Visualizer Pro handlers and SQL filters were not checked, because their source is not available.
- File writes could not be observed, because the sandbox database user has no FILE privilege.
- The variant pass did not settle these places, where the fixed cause may still reach:
classes/Visualizer/Source/Query/Params.php:103-112,254-262,291-304— unverified: Column discovery interpolates $table into SQL before the inherited SELECT check. Whether request-controlled table expressions reach these methods depends on unavailable Pro callers…classes/Visualizer/Module/Chart.php:1719-1739— unverified: Pro callbacks receive filter-save requests, REST action records, and post-validation SQL. Their authorization, accepted fields and possible SQL replacement cannot be settled withou…classes/Visualizer/Module/Frontend.php:269— unverified: Pro callbacks receive filter-save requests, REST action records, and post-validation SQL. Their authorization, accepted fields and possible SQL replacement cannot be settled withou…classes/Visualizer/Source/Query.php:153-159— unverified: Pro callbacks receive filter-save requests, REST action records, and post-validation SQL. Their authorization, accepted fields and possible SQL replacement cannot be settled withou…classes/Visualizer/Module.php:731-744— unverified: Chart editors reach visualizer_save_filter; unavailable Pro callbacks determine whether request fields can configure privileged sources without additional authorization.classes/Visualizer/Module/Chart.php:1191-1196,1371-1372,1385-1405— unverified: the table/excel editor branch passes submitted data to visualizer_pro_handle_chart_data, then fetches and stores the returned source. Missing Pro implementation determines whether …
🤖 Automated review · run code-review-agent_6b09d1a0421d31.79092034.
🤖 Review agent — review posted ✅ on 94cbd144 · approved · 0 findings · 18 min
Run code-review-agent_6b09d1a0421d31.79092034 · trail
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.
Chart configuration is stored in post meta that only the chart editor is meant to write. WordPress now treats those keys as protected, and the database source refuses three more file statements.
What changed
Chart meta — post meta keys that start with
visualizer-are protected. The Custom Fields panel, XML-RPC and the REST API no longer accept them. The chart editor, imports, schedules and abilities write throughupdate_post_meta()and work as before.Database source — a query that contains
INTO OUTFILE,INTO DUMPFILEorLOAD_FILEis refused, like the other statements on the disallow list.Note
Tracked in Codeinwp/visualizer-pro#652.
QA
Go to
WP Admin → Visualizer → Chart Library. Create a chart, change a setting and save it.Expect: the chart saves, and it shows the new setting after a page reload.
Go to
WP Admin → Posts → Add New. OpenOptions (⋮) → Preferences → General → Advancedand turn on Custom fields. In the Custom Fields panel, add a field with the namevisualizer-testand any value.Expect: WordPress does not add the field.
In the same panel, add a field with the name
my-testand any value.Expect: WordPress adds the field.
🤖 Generated with Claude Code