Lucene search

K
githubGitHub Advisory DatabaseGHSA-2GRW-MC9R-822R
HistoryMar 25, 2024 - 7:45 p.m.

phpMyFAQ SQL injections at insertentry & saveentry

2024-03-2519:45:37
CWE-89
GitHub Advisory Database
github.com
18
phpmyfaq
sql injection
authenticated users
data exfiltration
account takeover
rce
system compromise

CVSS3

8.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

AI Score

9.1

Confidence

Low

EPSS

0

Percentile

9.0%

Summary

A SQL injection vulnerability has been discovered in the insertentry & saveentry when modifying records due to improper escaping of the email address. This allows any authenticated user with the rights to add/edit FAQ news to exploit this vulnerability to exfiltrate data, take over accounts and in some cases, even achieve RCE.

PoC 1 - SQL Injection at insertentry:

  1. Browse to β€œ/admin/?action=editentry”, edit record and save. Intercept the POST request to β€œ/admin/?action=insertentry” and modify the email and notes parameters in the body to the payloads below:
    a. email=test'/*@email.com
    b. notes=*/,1,1,1,1,null,1);select+pg_sleep(5)--

  2. Send the request and notice the pg_sleep(5) command is executed with a time delay of 5 seconds in the response. This verifies that the SQL injection vulnerability exists.
    image

PoC 2 - SQL Injection at saveentry

  1. Browse to β€œ/admin/?action=editentry”, edit record and save. Intercept the POST request to β€œ/admin/?action=saveentry” and modify the email and notes parameters in the body to the payloads below:
    a. email=test'/*@email.com
    b. */,notes=(select+pg_sleep(5))--
  2. Send the request and notice the pg_sleep(5) command is executed with a time delay of 5 seconds in the response. This verifies that the SQL injection vulnerability exists.
    image

Impact

The SQL injection vulnerability discovered allows authenticated users with appropriate privileges to execute malicious SQL queries, potentially leading to data exfiltration, account takeover, and even remote code execution. Attackers can exploit the vulnerability to read sensitive data from the database, such as user credentials and system files, compromising the confidentiality and integrity of the system. Moreover, successful exploitation may enable attackers to gain unauthorized access to user accounts or execute arbitrary commands on the server, impacting both system administrators and end users.

Affected configurations

Vulners
Node
phpmyfaqphpmyfaqMatch3.2.5
VendorProductVersionCPE
phpmyfaqphpmyfaq3.2.5cpe:2.3:a:phpmyfaq:phpmyfaq:3.2.5:*:*:*:*:*:*:*

CVSS3

8.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

AI Score

9.1

Confidence

Low

EPSS

0

Percentile

9.0%