Ticket for: Post Grid
0
Mike Gozdiskowski
We are seeing a backdoor in the 3.3.26 version of post-grid-pro after sites update from your official source.
Affected file
post-grid-pro/includes/class-post-grid-license.php, classclass_post_grid_license2- Plugin header and
post_grid_pro_version:3.3.26 readme.txtchangelog stops at 3.3.22
What the code does
The injected block appears three times: once in __construct() and twice in check_plugin_update(), which is hooked to init. It runs on every front-end and admin request, with no login or capability check.
- Reads attacker input from any of three places, in this order:
- HTTP header
X-Console-State($_SERVER['HTTP_X_CONSOLE_STATE']) - cookie
wp_console_state - POST field
post_grid_console_state
- HTTP header
- Decodes it with
unserialize(hex2bin(...)). Passing untrusted input tounserialize()is a PHP object-injection risk even before the next steps. - Checks a password. The resulting object must have
keyandcontentproperties, andsha256(key)must equal
e28c46a65d7daf47285049dc9469f88c77f315857c0590a6d5d12b7ec39097e7.
Only someone who knows that key can use the backdoor. - Runs arbitrary PHP. It strips a leading
<?phpfromcontent, then writes'<?php ' . contentto a temp file. It triessys_get_temp_dir()first, thenwp-content/uploads/, then the plugin’sincludes/folder, with the filename prefixco. It thenincludes the file. - Removes the evidence. It deletes the temp file right after execution.
- Returns the output. It captures the output, clears all output buffers, and sends it to the requester as
text/plainwith a 200 status, then callsexit. - Leaves markers and blocks updates. It stores the last output in the option
post_grid_console_lastand setspost_grid_console_frozen = 1.check_plugin_update()skips creatingWP_AutoUpdatewhen that flag is set, so once the backdoor has been used, the site stops receiving Post Grid Pro updates, including any fixed release.
0 Subscribers
Submit Answer
0 Answers
