Shared security patch analysis results
AI Used: claude_cli haikuComprehensive security analysis generated by AI for each confirmed CVE match. Click on a CVE to view the detailed writeup including vulnerability background, technical details, patch analysis, and PoC guide.
--- cache/memsource-connector_4.7.5/memsource.php 2026-01-18 00:23:57.409032393 +0000+++ cache/memsource-connector_4.7.6/memsource.php 2026-01-18 00:27:07.344822009 +0000@@ -4,7 +4,7 @@ Plugin Name: Phrase TMS Integration for WordPress Plugin URI: https://support.phrase.com/hc/en-us/articles/5709657294620 Description: Localize WordPress websites with the help of professional translation tools: translation memories, terminology bases and quality checkers.-Version: 4.7.5+Version: 4.7.6 Text Domain: memsource Domain Path: /locale Author: Phrase@@ -17,7 +17,7 @@ use Memsource\Utils\LogUtils; define('MEMSOURCE_PLUGIN_PATH', dirname(__FILE__));-define('MEMSOURCE_PLUGIN_VERSION', '4.7.5');+define('MEMSOURCE_PLUGIN_VERSION', '4.7.6'); define('MEMSOURCE_PLUGIN_DIR_URL', plugin_dir_url(__FILE__)); define('MEMSOURCE_PLUGIN_REQUIERED_PHP_VERSION', '7.4'); @@ -101,6 +101,17 @@ wp_enqueue_script('memsource_js'); wp_enqueue_script('clipboard_js'); wp_enqueue_style('memsource_css');+ wp_localize_script(+ 'memsource_js',+ 'memsourceAjax',+ [+ 'ajaxUrl' => admin_url('admin-ajax.php'),+ 'nonces' => [+ 'emailLog' => wp_create_nonce('memsource_zip_and_email_log_action'),+ 'deleteLog' => wp_create_nonce('memsource_delete_log_action'),+ ],+ ]+ ); } function memsource_plugin_setup_menu()@@ -312,19 +323,27 @@ function memsource_zip_and_email_log() {- LogUtils::logSystemInfo();- header('Content-Type: application/json');- $zipFile = LogUtils::zipAndEmailLogFile();- echo json_encode(['zipFile' => $zipFile, 'email' => LogUtils::LOG_EMAIL_RECIPIENT]);- wp_die();+ check_ajax_referer('memsource_zip_and_email_log_action', 'security');++ if (current_user_can("manage_options")) {+ LogUtils::logSystemInfo();+ header('Content-Type: application/json');+ $zipFile = LogUtils::zipAndEmailLogFile();+ echo json_encode(['zipFile' => $zipFile, 'email' => LogUtils::LOG_EMAIL_RECIPIENT]);+ wp_die();+ } } function memsource_delete_log() {- header('Content-Type: application/json');- $result = LogUtils::deleteLogFile();- echo json_encode($result);- wp_die();+ check_ajax_referer('memsource_delete_log_action', 'security');++ if (current_user_can("manage_options")) {+ header('Content-Type: application/json');+ $result = LogUtils::deleteLogFile();+ echo json_encode($result);+ wp_die();+ } } function memsource_delete_post($id)
I'll analyze this code diff for security vulnerabilities.
---
**Vulnerability 1: Missing CSRF Protection (Fixed)**
Vulnerability Existed: yes
TRUE POSITIVE
Cross-Site Request Forgery (CSRF) - CWE-352 - memsource.php lines 325-334 and 337-344
Old Code:
```php
function memsource_zip_and_email_log()
{
LogUtils::logSystemInfo();
header('Content-Type: application/json');
$zipFile = LogUtils::zipAndEmailLogFile();
echo json_encode(['zipFile' => $zipFile, 'email' => LogUtils::LOG_EMAIL_RECIPIENT]);
wp_die();
}
function memsource_delete_log()
{
header('Content-Type: application/json');
$result = LogUtils::deleteLogFile();
echo json_encode($result);
wp_die();
}
```
Fixed Code:
```php
function memsource_zip_and_email_log()
{
check_ajax_referer('memsource_zip_and_email_log_action', 'security');
if (current_user_can("manage_options")) {
LogUtils::logSystemInfo();
header('Content-Type: application/json');
$zipFile = LogUtils::zipAndEmailLogFile();
echo json_encode(['zipFile' => $zipFile, 'email' => LogUtils::LOG_EMAIL_RECIPIENT]);
wp_die();
}
}
function memsource_delete_log()
{
check_ajax_referer('memsource_delete_log_action', 'security');
if (current_user_can("manage_options")) {
header('Content-Type: application/json');
$result = LogUtils::deleteLogFile();
echo json_encode($result);
wp_die();
}
}
```
Explanation:
The original functions lacked CSRF protection and authorization checks. Attackers could craft malicious pages to trick authenticated users into deleting logs or emailing logs without explicit consent. The fix adds `check_ajax_referer()` to validate nonces passed via the localized script data, ensuring requests originate from the legitimate WordPress admin interface. Additionally, `current_user_can("manage_options")` verifies administrative privileges before executing sensitive operations.
---
**Vulnerability 2: Missing Authorization Check (Fixed)**
Vulnerability Existed: yes
TRUE POSITIVE
Improper Access Control / Missing Authorization - CWE-862 - memsource.php lines 325-334 and 337-344
Old Code:
```php
function memsource_zip_and_email_log()
{
LogUtils::logSystemInfo();
// ... no capability check
}
function memsource_delete_log()
{
// ... no capability check
}
```
Fixed Code:
```php
function memsource_zip_and_email_log()
{
check_ajax_referer('memsource_zip_and_email_log_action', 'security');
if (current_user_can("manage_options")) {
// ... operations only execute for admins
}
}
function memsource_delete_log()
{
check_ajax_referer('memsource_delete_log_action', 'security');
if (current_user_can("manage_options")) {
// ... operations only execute for admins
}
}
```
Explanation:
The original code performed sensitive operations (logging system info, deleting logs, emailing logs) without verifying user capabilities. Any authenticated user, regardless of role, could trigger these actions. The fix restricts execution to users with `manage_options` capability (administrators only), preventing privilege escalation and unauthorized access to sensitive system information.
The Phrase TMS Integration for WordPress plugin for WordPress is vulnerable to unauthorized modification of data due to a missing capability check on the 'wp_ajax_delete_log' AJAX endpoint in all versions up to, and including, 4.7.5. This makes it possible for authenticated attackers, with Subscriber-level access and above, to delete log files.
--- cache/memsource-connector_4.7.5/src/Page/AdvancedPage.php 2026-01-18 00:23:57.417032889 +0000+++ cache/memsource-connector_4.7.6/src/Page/AdvancedPage.php 2026-01-18 00:27:07.352822506 +0000@@ -30,10 +30,11 @@ function emailToMemsource() { if (confirm("<?php _e('Do you really want to send the log file to Phrase?', 'memsource'); ?>")) { var data = {- action: 'zip_and_email_log'+ action: 'zip_and_email_log',+ security: memsourceAjax.nonces.emailLog }; jQuery('#email-spinner').addClass('is-active');- jQuery.post(ajaxurl, data, function(response) {+ jQuery.post(memsourceAjax.ajaxUrl, data, function(response) { jQuery('#email-spinner').removeClass('is-active'); jQuery('#email-result').html('File ' + response.zipFile + ' has been sent to Phrase.'); });@@ -42,10 +43,11 @@ function deleteLogFile() { if (confirm("<?php _e('Do you really want to delete the log file?', 'memsource'); ?>")) { var data = {- action: 'delete_log'+ action: 'delete_log',+ security: memsourceAjax.nonces.deleteLog }; jQuery('#delete-spinner').addClass('is-active');- jQuery.post(ajaxurl, data, function(response) {+ jQuery.post(memsourceAjax.ajaxUrl, data, function(response) { jQuery('#delete-spinner').removeClass('is-active'); var files = []; if (response.logDeleted) {
# Security Analysis: AdvancedPage.php Diff
## Vulnerability 1
**Vulnerability Existed:** yes
**Cross-Site Request Forgery (CSRF) - CWE-352 - src/Page/AdvancedPage.php Lines 33-34, 44-45**
**Old Code:**
```javascript
var data = {
action: 'zip_and_email_log'
};
```
**Fixed Code:**
```javascript
var data = {
action: 'zip_and_email_log',
security: memsourceAjax.nonces.emailLog
};
```
**Explanation:**
The original code was missing CSRF token (nonce) validation in AJAX requests. The fix adds a security nonce (`memsourceAjax.nonces.emailLog`) to the POST request data, which prevents CSRF attacks by ensuring that requests originate from authenticated sessions with valid tokens. This is a critical WordPress security practice for AJAX endpoints.
---
## Vulnerability 2
**Vulnerability Existed:** yes
**Cross-Site Request Forgery (CSRF) - CWE-352 - src/Page/AdvancedPage.php Lines 45-46, 50-51**
**Old Code:**
```javascript
var data = {
action: 'delete_log'
};
```
**Fixed Code:**
```javascript
var data = {
action: 'delete_log',
security: memsourceAjax.nonces.deleteLog
};
```
**Explanation:**
Same CSRF vulnerability as Vulnerability 1. The delete log action was also missing nonce validation. The fix adds the appropriate security nonce (`memsourceAjax.nonces.deleteLog`) to protect against CSRF attacks on this destructive operation.
---
## Vulnerability 3
**Vulnerability Existed:** yes
**Improper Use of Global Variable / Potential Security Issue - CWE-226 - src/Page/AdvancedPage.php Lines 37, 50**
**Old Code:**
```javascript
jQuery.post(ajaxurl, data, function(response) {
```
**Fixed Code:**
```javascript
jQuery.post(memsourceAjax.ajaxUrl, data, function(response) {
```
**Explanation:**
The original code relies on a global `ajaxurl` variable, which may be unreliable or subject to manipulation. The fix uses `memsourceAjax.ajaxUrl`, which is a properly encapsulated variable passed via WordPress localization, ensuring the correct and controlled AJAX endpoint is used. This prevents potential endpoint manipulation attacks and improves code maintainability.
The Phrase TMS Integration for WordPress plugin for WordPress is vulnerable to unauthorized modification of data due to a missing capability check on the 'wp_ajax_delete_log' AJAX endpoint in all versions up to, and including, 4.7.5. This makes it possible for authenticated attackers, with Subscriber-level access and above, to delete log files.