wpjobmanager - unserialize of user input
The get_job_listings function serialises query results and stores them in a transient, and is reachable by unauthenticated users via an AJAX action. User input reaches this caching logic, which could in theory lead to object injection if unserialised.
b258ea62bf297b02afa9854 Follow
Originally disclosed on HackerOne
- Triaged in 6 days
- Fixed in 8 days
- Paid in 8 days
- Disclosed after 38 days
Vulnerability occurs in get_job_listings function to be more precise line 160 - 164 in wp-job-manager-functions.php.
$result = new WP_Query( $query_args );
$cached_query = false;
set_transient( $query_args_hash, $result, DAY_IN_SECONDS );
e.g. you perform serialize on object that have esc_sql-ed values and after that you insert it in the database.
Function get_job_listings is called on many places in the plugin where its input is filled in by not authorized users => pre auth unserialization of user supplied input like in class-wp-job-manager-ajax.php :
add_action( 'job_manager_ajax_get_listings', array( $this, 'get_listings' ) );
Same issue was reported and fixed here https://woocommerce.wordpress.com/2017/11/16/woocommerce-3-2-4-security-fix-release-notes/ ( there is H1 report for it ) and it is based on this research https://medium.com/websec/wordpress-4-8-3-wrecking-ball-b172e2511fad
Impact
If found interesting POI gadget chain or underling PHP is vulnerable from latest unserialize issues could cause multiple vulnerabilities from XSS to RCE.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely user-controlled input reaches a serialise/unserialise round-trip in the caching logic of get_job_listings, allowing PHP object injection.
Impact
If a suitable POP gadget chain exists or the underlying PHP is vulnerable to recent unserialise issues, this could lead to multiple vulnerabilities from XSS to RCE.
What the attacker needed
No authentication required; a usable POP gadget chain
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Some PHP code stores data by turning it into a text string (serialising) and later turns it back into objects (unserialising). If an attacker can influence that text, they may be able to make the site build objects they choose, which can be abused. Here the function that does this can be reached without logging in.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.