From e2471a737c1b3fcbaed965a84da2541f86920b42 Mon Sep 17 00:00:00 2001 From: "advisory-database[bot]" <45398580+advisory-database[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 19:46:19 +0000 Subject: [PATCH] Publish Advisories GHSA-2grw-mc9r-822r GHSA-48vw-jpf8-hwqh GHSA-6p68-36m6-392r GHSA-hm8r-95g3-5hj9 GHSA-qgxx-4xv5-6hcw --- .../GHSA-2grw-mc9r-822r.json | 60 ++++++++++++++++ .../GHSA-48vw-jpf8-hwqh.json | 65 ++++++++++++++++++ .../GHSA-6p68-36m6-392r.json | 64 +++++++++++++++++ .../GHSA-hm8r-95g3-5hj9.json | 60 ++++++++++++++++ .../GHSA-qgxx-4xv5-6hcw.json | 68 +++++++++++++++++++ 5 files changed, 317 insertions(+) create mode 100644 advisories/github-reviewed/2024/03/GHSA-2grw-mc9r-822r/GHSA-2grw-mc9r-822r.json create mode 100644 advisories/github-reviewed/2024/03/GHSA-48vw-jpf8-hwqh/GHSA-48vw-jpf8-hwqh.json create mode 100644 advisories/github-reviewed/2024/03/GHSA-6p68-36m6-392r/GHSA-6p68-36m6-392r.json create mode 100644 advisories/github-reviewed/2024/03/GHSA-hm8r-95g3-5hj9/GHSA-hm8r-95g3-5hj9.json create mode 100644 advisories/github-reviewed/2024/03/GHSA-qgxx-4xv5-6hcw/GHSA-qgxx-4xv5-6hcw.json diff --git a/advisories/github-reviewed/2024/03/GHSA-2grw-mc9r-822r/GHSA-2grw-mc9r-822r.json b/advisories/github-reviewed/2024/03/GHSA-2grw-mc9r-822r/GHSA-2grw-mc9r-822r.json new file mode 100644 index 00000000000..b1e13f53e7a --- /dev/null +++ b/advisories/github-reviewed/2024/03/GHSA-2grw-mc9r-822r/GHSA-2grw-mc9r-822r.json @@ -0,0 +1,60 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-2grw-mc9r-822r", + "modified": "2024-03-25T19:45:37Z", + "published": "2024-03-25T19:45:37Z", + "aliases": [ + "CVE-2024-28107" + ], + "summary": "phpMyFAQ SQL injections at insertentry & saveentry", + "details": "### Summary\nA 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.\n\n### PoC 1 - SQL Injection at insertentry:\n1. 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:\n a. `email=test'/*@email.com`\n b. `notes=*/,1,1,1,1,null,1);select+pg_sleep(5)--`\n\n2. 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. \n ![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/1000482f-3b00-462a-be8a-1eb21f720aca)\n\n### PoC 2 - SQL Injection at saveentry\n1. 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:\n a. `email=test'/*@email.com`\n b. `*/,notes=(select+pg_sleep(5))--`\n 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.\n ![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/b1880ad1-1461-4735-9a67-9aa4d6c19b13)\n\n\n### Impact\nThe 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.", + "severity": [ + { + "type": "CVSS_V3", + "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H" + } + ], + "affected": [ + { + "package": { + "ecosystem": "Packagist", + "name": "phpmyfaq/phpmyfaq" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "3.2.5" + }, + { + "fixed": "3.2.6" + } + ] + } + ], + "versions": [ + "3.2.5" + ] + } + ], + "references": [ + { + "type": "WEB", + "url": "https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-2grw-mc9r-822r" + }, + { + "type": "PACKAGE", + "url": "https://github.com/thorsten/phpMyFAQ" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-89" + ], + "severity": "HIGH", + "github_reviewed": true, + "github_reviewed_at": "2024-03-25T19:45:37Z", + "nvd_published_at": null + } +} \ No newline at end of file diff --git a/advisories/github-reviewed/2024/03/GHSA-48vw-jpf8-hwqh/GHSA-48vw-jpf8-hwqh.json b/advisories/github-reviewed/2024/03/GHSA-48vw-jpf8-hwqh/GHSA-48vw-jpf8-hwqh.json new file mode 100644 index 00000000000..055e6899a14 --- /dev/null +++ b/advisories/github-reviewed/2024/03/GHSA-48vw-jpf8-hwqh/GHSA-48vw-jpf8-hwqh.json @@ -0,0 +1,65 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-48vw-jpf8-hwqh", + "modified": "2024-03-25T19:45:24Z", + "published": "2024-03-25T19:45:23Z", + "aliases": [ + "CVE-2024-28108" + ], + "summary": "phpMyFAQ Stored HTML Injection at contentLink", + "details": "### Summary\nDue to insufficient validation on the `contentLink` parameter, it is possible for unauthenticated users to inject HTML code to the page which might affect other users. _Also, requires that adding new FAQs is allowed for guests and that the admin doesn't check the content of a newly added FAQ._\n\n### PoC\n1. Browse to ../phpmyfaq/index.php?action=add&cat=0 , enter `https://test.com?p=

HTML_INJECTION

` for the contentLink parameter.\n![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/4925d1ab-aa64-4781-8a44-f4c30cb8499c)\n\n2. Verify the HTML injection by viewing the FAQ itself, “All categories” → “CategoryName” → ”QuestionName”.\n![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/54b077d8-fab4-4cb6-870c-f19fc25d8252)\n\n### Impact\nAttackers can manipulate the appearance and functionality of web pages by injecting malicious HTML code. This can lead to various undesirable outcomes, such as defacing the website, redirecting users to malicious sites, or altering the content to deceive users. Additionally, unauthenticated HTML injection can compromise user privacy by displaying sensitive information or misleading content. It undermines the integrity of the application and erodes user trust, potentially resulting in loss of reputation and credibility. ", + "severity": [ + { + "type": "CVSS_V3", + "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N" + } + ], + "affected": [ + { + "package": { + "ecosystem": "Packagist", + "name": "phpmyfaq/phpmyfaq" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "3.2.5" + }, + { + "fixed": "3.2.6" + } + ] + } + ], + "versions": [ + "3.2.5" + ] + } + ], + "references": [ + { + "type": "WEB", + "url": "https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-48vw-jpf8-hwqh" + }, + { + "type": "WEB", + "url": "https://github.com/thorsten/phpMyFAQ/commit/4fed1d9602f0635260f789fe85995789d94d6634" + }, + { + "type": "PACKAGE", + "url": "https://github.com/thorsten/phpMyFAQ" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-79", + "CWE-80" + ], + "severity": "MODERATE", + "github_reviewed": true, + "github_reviewed_at": "2024-03-25T19:45:23Z", + "nvd_published_at": null + } +} \ No newline at end of file diff --git a/advisories/github-reviewed/2024/03/GHSA-6p68-36m6-392r/GHSA-6p68-36m6-392r.json b/advisories/github-reviewed/2024/03/GHSA-6p68-36m6-392r/GHSA-6p68-36m6-392r.json new file mode 100644 index 00000000000..ab07285a1e2 --- /dev/null +++ b/advisories/github-reviewed/2024/03/GHSA-6p68-36m6-392r/GHSA-6p68-36m6-392r.json @@ -0,0 +1,64 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-6p68-36m6-392r", + "modified": "2024-03-25T19:45:52Z", + "published": "2024-03-25T19:45:52Z", + "aliases": [ + "CVE-2024-28106" + ], + "summary": "phpMyFAQ Stored Cross-site Scripting at FAQ News Content", + "details": "### Summary\nBy manipulating the news parameter in a POST request, an attacker can inject malicious JavaScript code. Upon browsing to the compromised news page, the XSS payload triggers.\n\n### PoC\n1. Edit a FAQ news, intercept the request and modify the `news` parameter in the POST body with the following payload: `%3cscript%3ealert('xssContent')%3c%2fscript%3e`\n2. Browse to the particular news page and the XSS should pop up.\n![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/01312703-c54c-4ee6-9f2c-0dd1bf1b23cf)\n\n### Impact\nThis allows an attacker to execute arbitrary client side JavaScript within the context of another user's phpMyFAQ session", + "severity": [ + { + "type": "CVSS_V3", + "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:L" + } + ], + "affected": [ + { + "package": { + "ecosystem": "Packagist", + "name": "phpmyfaq/phpmyfaq" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "3.2.5" + }, + { + "fixed": "3.2.6" + } + ] + } + ], + "versions": [ + "3.2.5" + ] + } + ], + "references": [ + { + "type": "WEB", + "url": "https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-6p68-36m6-392r" + }, + { + "type": "WEB", + "url": "https://github.com/thorsten/phpMyFAQ/commit/c94b3deadd87789389e1fad162bc3dd595c0e15a" + }, + { + "type": "PACKAGE", + "url": "https://github.com/thorsten/phpMyFAQ" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-79" + ], + "severity": "MODERATE", + "github_reviewed": true, + "github_reviewed_at": "2024-03-25T19:45:52Z", + "nvd_published_at": null + } +} \ No newline at end of file diff --git a/advisories/github-reviewed/2024/03/GHSA-hm8r-95g3-5hj9/GHSA-hm8r-95g3-5hj9.json b/advisories/github-reviewed/2024/03/GHSA-hm8r-95g3-5hj9/GHSA-hm8r-95g3-5hj9.json new file mode 100644 index 00000000000..47d3e6f2330 --- /dev/null +++ b/advisories/github-reviewed/2024/03/GHSA-hm8r-95g3-5hj9/GHSA-hm8r-95g3-5hj9.json @@ -0,0 +1,60 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-hm8r-95g3-5hj9", + "modified": "2024-03-25T19:45:12Z", + "published": "2024-03-25T19:45:12Z", + "aliases": [ + "CVE-2024-29179" + ], + "summary": "phpMyFAQ Stored Cross-site Scripting at File Attachments", + "details": "### Summary\nAn attacker with admin privileges can upload an attachment containing JS code without extension and the application will render it as HTML which allows for XSS attacks.\n\n### Details\nWhen attachments are uploaded without an extension, the application renders it as HTML by default. Therefore allowing attackers to upload .html files containing javascript code to perform XSS attacks. The direct file path to the uploaded attachment is also easily obtainable as it is made up of substrings of the file's MD5 hashes.\n\n### PoC\n1. Admin users can upload attachments containing XSS payloads in files without extensions to bypass the .html extension check.\n![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/5c3c4222-550e-44c7-95ee-fd85562fffd5)\n\n2. Since the path of the uploaded file is built entirely on the file’s MD5 hash and the attachment directory, it is possible for an attacker to know the direct path of the uploaded file.\n\n E.g file MD5 hash: 38fff51cb7248a06d6142c6bdf846831\n\n URL will be: http://127.0.0.1/phpmyfaq/attachments/38fff/51cb7/248a0/6d6142c6bdf846831\n\n - /attachments\n - /38fff (first 5 chars of MD5 hash)\n - /51cb7 (next 5 chars of MD5 hash)\n - /248a0 (next 5 chars of MD5 hash)\n - /6d6142c6bdf846831 (remaining chars of MD5 hash)\n\n3. Even though the attachment was uploaded without a file extension, it is still rendered as .html, hence triggering the XSS payload.\n![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/663954ec-0210-4788-a841-7daa3fb547c3)\n\n### Impact\nThis allows an attacker to execute arbitrary client side JavaScript within the context of another user's phpMyFAQ session.\n\n", + "severity": [ + { + "type": "CVSS_V3", + "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:L" + } + ], + "affected": [ + { + "package": { + "ecosystem": "Packagist", + "name": "phpmyfaq/phpmyfaq" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "3.2.5" + }, + { + "fixed": "3.2.6" + } + ] + } + ], + "versions": [ + "3.2.5" + ] + } + ], + "references": [ + { + "type": "WEB", + "url": "https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-hm8r-95g3-5hj9" + }, + { + "type": "PACKAGE", + "url": "https://github.com/thorsten/phpMyFAQ" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-79" + ], + "severity": "MODERATE", + "github_reviewed": true, + "github_reviewed_at": "2024-03-25T19:45:12Z", + "nvd_published_at": null + } +} \ No newline at end of file diff --git a/advisories/github-reviewed/2024/03/GHSA-qgxx-4xv5-6hcw/GHSA-qgxx-4xv5-6hcw.json b/advisories/github-reviewed/2024/03/GHSA-qgxx-4xv5-6hcw/GHSA-qgxx-4xv5-6hcw.json new file mode 100644 index 00000000000..b2c598f10f9 --- /dev/null +++ b/advisories/github-reviewed/2024/03/GHSA-qgxx-4xv5-6hcw/GHSA-qgxx-4xv5-6hcw.json @@ -0,0 +1,68 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-qgxx-4xv5-6hcw", + "modified": "2024-03-25T19:44:05Z", + "published": "2024-03-25T19:44:05Z", + "aliases": [ + "CVE-2024-27299" + ], + "summary": "phpMyFAQ SQL Injection at \"Save News\"", + "details": "### Summary\nA SQL injection vulnerability has been discovered in the the \"Add News\" functionality 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.\n\n### Details\nThe vulnerable field lies in the `authorEmail` field which uses PHP's `FILTER_VALIDATE_EMAIL` filter. This filter is insufficient in protecting against SQL injection attacks and should still be properly escaped. However, in this version of phpMyFAQ (3.2.5), this field is not escaped properly can be used together with other fields to fully exploit the SQL injection vulnerability.\n\n### PoCs\n4 PoCs are demonstrated here to illustrate the potential impacts.\n\n#### PoC 1 - Postgres Time Based SQLi\n1. Login as admin or any user with the rights to view and save news.\n2. Navigate to \"../phpmyfaq/admin/?action=news\", click on \"Add news\", fill in some data, send and intercept the request.\n3. Modify the intercepted \"/admin/?action=save-news\" request to look like the SS below:\n 3.1 - Set the \"authorEmail\" field in the body to \"`test'/*@[email.com](http://email.com/)`\".\n 3.2 - Set the \"linkTitle\" field in the body to \"`*/,1,1,1,1,1,1,1);select+pg_sleep(5)--`\".\n 3.3 - Set the rest of the fields as empty and send the request.\n4. Notice the 5s delay in the response time, indicating that the sleep function was executed, verifying the existence of the SQLi vulnerability.\n![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/b19a3f88-0794-4919-a485-60f45cfc83a5)\n\n#### PoC 2 - SQLi to Read Data from PostgresDB \n1. Steps 1 and 2 are the same as PoC 1.\n2. Modify the intercepted \"/admin/?action=save-news\" request to look like the SS below and send the request:\n 2.1 - Set the \"authorEmail\" field in the body to \"`test'/*@[email.com](http://email.com/)`\".\n 2.2 - Set the \"linkTitle\" field in the body to \"`*/,1,1,1,1,1,1,1);SELECT+remember_me+FROM+faquser+limit+1+offset+1%3b--`\".\n![image (1)](https://github.com/thorsten/phpMyFAQ/assets/63487456/131a6b5f-cfbf-4d94-9851-73f4d9e1605a)\n\n#### PoC 3 - SQLi to Read Files from PostgresDB \n1. Steps 1 and 2 are the same as PoC 1.\n2. Modify the intercepted \"/admin/?action=save-news\" request to look like the SS below and send the request:\n 2.1 - Set the \"authorEmail\" field in the body to \"`test'/*@[email.com](http://email.com/)`\".\n 2.2 - Set the \"linkTitle\" field in the body to \"`*/,1,1,1,1,1,(select+pg_read_file(CONCAT(CHR(67),CHR(58),CHR(92),CHR(87),CHR(105),CHR(110),CHR(100),CHR(111),CHR(119),CHR(115),CHR(92),CHR(119),CHR(105),CHR(110),CHR(46),CHR(105),CHR(110),CHR(105)))),1)--`\". (_the CONCAT() and CHR() functions are used to bypass the escaping of single quotes, these characters in its decoded form is \"select pg_read_file('C:\\Windows\\win.ini')\"_)\n![image (2)](https://github.com/thorsten/phpMyFAQ/assets/63487456/61857d4c-4eab-43e3-87fa-20eefe6553e5)\n\n#### PoC 4 - SQLi to Shell\nIt is also possible to obtain a shell if superuser is enabled on the postgres DB. These are the high level steps of the exploit chain:\n\n1. Create a table called \"cmd_exec\" to store the payload.\n2. Create a function in postgres to store the command to write a web shell to the \"../htdocs\" directory. (This step is required as CONCAT() function cannot be used to bypass the step where; \"COPY cmd_exec FROM PROGRAM '' \" is run as it requires single quotes.)\n3. Trigger the function to write the PHP web shell at \"`http:///shell.php`\" that takes in commands via the \"?cmd=\" parameter.\n4. Send the Python reverse shell command via a GET request to launch the reverse shell. \n\nThe video demo and the Python PoC script can be accessed from this link: https://drive.google.com/drive/folders/1BFL8GHIBxSUxu0TneYf66KjFA0A4RZga?usp=sharing\n\n### Impact\nThe SQL injection vulnerability discovered in the \"Add News\" functionality of the application 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.\n", + "severity": [ + { + "type": "CVSS_V3", + "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H" + } + ], + "affected": [ + { + "package": { + "ecosystem": "Packagist", + "name": "phpmyfaq/phpmyfaq" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "3.2.5" + }, + { + "fixed": "3.2.6" + } + ] + } + ], + "versions": [ + "3.2.5" + ] + } + ], + "references": [ + { + "type": "WEB", + "url": "https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-qgxx-4xv5-6hcw" + }, + { + "type": "WEB", + "url": "https://github.com/thorsten/phpMyFAQ/commit/1b68a5f89fb65996c56285fa636b818de8608011" + }, + { + "type": "WEB", + "url": "https://drive.google.com/drive/folders/1BFL8GHIBxSUxu0TneYf66KjFA0A4RZga?usp=sharing" + }, + { + "type": "PACKAGE", + "url": "https://github.com/thorsten/phpMyFAQ" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-89" + ], + "severity": "HIGH", + "github_reviewed": true, + "github_reviewed_at": "2024-03-25T19:44:05Z", + "nvd_published_at": null + } +} \ No newline at end of file