Zum Hauptinhalt springen
LIVE
CVSS 6.9CVE-2026-138105 | A vulnerability has been found in ssssssss-team magic-api 2.2.2. The affected element is an unknown function of the file /magic/web/datasource/jdbc/test of the component Datasource JDBC Test Endpoint. Such manipulation of the argument driverClassName leads to code injection. The attack can be launched remotely. The exploit has been disclosed to the public and may be used. The project was informed of the problem early through an issue report but has not respoCVSS 6.9CVE-2026-138104 | A flaw has been found in ssssssss-team magic-api up to 2.2.2. Impacted is the function push of the file magic-api/src/main/java/org/ssssssss/magicapi/core/web/MagicWorkbenchController.java of the component Workbench Push Interface. This manipulation of the argument magic-push-target causes server-side request forgery. The attack can be initiated remotely. The exploit has been published and may be used. The project was informed of the problem early through anCVSS 6.9CVE-2026-138103 | A vulnerability was detected in ssssssss-team magic-api up to 2.2.2. This issue affects the function saveFile of the file MagicResourceController.java of the component magic-api-core resource save API. The manipulation results in code injection. It is possible to launch the attack remotely. The exploit is now public and may be used. The project was informed of the problem early through an issue report but has not responded yet.CVSS 9.4CVE-2026-138102 | A security vulnerability has been detected in D-Link DIR-620S 4.0.2. This vulnerability affects unknown code of the file /usr/sbin/anweb of the component Diagnostic Handler. The manipulation of the argument I leads to os command injection. It is possible to initiate the attack remotely. The exploit has been disclosed publicly and may be used.CVSS 5.3CVE-2026-138101 | A weakness has been identified in MassGen up to 0.1.97. This affects the function _generate_subagent_yaml_config of the file massgen/subagent/manager.py of the component Subagent Delegation System. Executing a manipulation can lead to improper authorization. The attack may be performed from remote. The exploit has been made available to the public and could be used for attacks. The project was informed of the problem early through an issue report but has notCVSS 6.9CVE-2026-138100 | A security flaw has been discovered in MassGen up to 0.1.97. Affected by this issue is the function __init__ of the file massgen/filesystem_manager/_filesystem_manager.py. Performing a manipulation results in protection mechanism failure. The attack is possible to be carried out remotely. The exploit has been released to the public and may be used for attacks. The project was informed of the problem early through an issue report but has not responded yet.CVSS 8.7CVE-2026-138099 | A vulnerability was identified in Tenda AC10U 1.18.6. Affected by this vulnerability is the function readUsb of the component ATE Service. Such manipulation leads to out-of-bounds write. The attack can be executed remotely. The exploit is publicly available and might be used.CVSS 6.9CVE-2026-138098 | A vulnerability was determined in weison-tech yii2-cms up to 1.0.2. Affected is an unknown function of the file protected/core/config/common.php of the component RBAC Authorization. This manipulation causes improper authorization. Remote exploitation of the attack is possible.
Alle im Drawer
Intelligence View
⚡ tsecurity.de Intelligence

Shallow Copy VS Deep Copy In Java Script : Explained in easiest way

What is copying and how does it Work in JS? In JavaScript, Copying is the process of making duplicate of of an existing values like integer, string, objects…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Quelle & Fakten · 5 Min. Lesezeit
Quelle: dev.to
Rubrik: Programación segura




What is copying and how does it Work in JS?



In JavaScript, Copying is the process of making duplicate of of an existing values like integer, string, objects and function.

However this is not so easy and straightforward as it looks. It all depends upon either you are copying primitive data types or non-primitive data types. If you are copying a primitive data type then it would be working with primary value but in the case of non-primitive data types it work with referenced values.



Lets see how it works with primary value and the referenced values





Primitive Value (Copy By Value)



For primitive data types, there it is copy by value.

Let me show this to you with the help of an example in code block by just simply declaring an integer "a" and copying its value in another integer "b".




let a = 10;
let b = a; // Copying the value

b = 20; // Changing b does NOT affect a
console.log(a); // Output: 10






You can see that changing value of b does not affecting a. This all happens because JavaScript creates a completely new independent copy of the actual values in the memory.



On other hand primitive data types consist of integers, boolean values,strings, symbols, bigInt and null.






Non-Primitive Value (Copy By Reference)



For non- primitive data types, there it is copy by reference.

Let it make clear with example of non-primitive data type object.




let original = { name: "YOO" };
let copy = original; // Copying the reference!

copy.name = "NEW";

console.log(original.name); // "NEW" -> Oops! The original changed too.







In above code block there it is a object name original that is stored somewhere in memory, and variable hold a pointer(reference) to that location.

If you are copying the variable you are just copying the pointer, not the actual referenced value.

So, when you are changing the value in copied item it will change the actual value in it.






To solve this problem here comes the concept of Shallow Copy and Deep Copy:



Here comes the golden rule to understand the difference between shallow copy and deep copy.





  • A shallow copy copies the references.

  • A deep copy copies the values.




Its simple, let break it through analogy of pizza :



-- > For shallow copy it is same as you and your friend is sharing a same pizza. Whenever you and your friend eats pizza it shrinks.



-- > For deep copy it is like you both owns different pizza. If your friend eats a slice, his pizza gets shrinks your remains untouched and same goes with your friend's pizza when you eats your pizza, his pizza remains untouched.



And that's it , this is full concept that revolves around shallow copy and deep copy.

Now lets get it through some examples of javascript.









Shallow Copy in JavaScript:



A shallow copy duplicates the top level of values. If there are some nested values it still copies it but only the referenced values.





  • Using Spread Operator(...) -
    This is one of the most common techniques used to make shallow copy in JavaScript.




let original = { name: "YOO",
age: 22,
gender: "Male"
}; // Original named object.

let copyOriginal = { ...original} // making a shallow copy of original named object using spread operator.

console.log(copyOriginal.name) // Output --> YOO






But there is A Shallow trap, whenever it comes a nested values and copying through spread operator those nested values will share exactly same references. So changing these referenced values will also lead to the changes in actual values.



To solve this problem here comes the concept of Deep Copy, lets learn this through some examples of javaScript.






Deep Copy In JavaScript:



Deep Copy in JavaScript creates a differently new object to copy the actual values. Changes done in values of new copied objects are not displayed in the actual values.

Let us see some methods to create a deep copy in JavaScript.





  • Using built in function structuredClone() :
    StructuredClone() is a built in javaScript function that is available in all modern day browser and Node.js. It handles deep nested structure perfectly. It is built into the runtime(browser and node.js) and handles most complex data types smoothly.




let Teas = {            // Create a object named as tea with some values inside it
name: "Lemon tea",
caffine: "No",
tasty: "Yes"
}

let newTeas = structuredClone(Teas); // Creating a deep copy of teas using structured clone method

newTeas.name = "Mango Tea";
console.log(Teas); //Output --> { name: 'Lemon tea', caffine: 'No', tasty: 'Yes' }
console.log(newTeas); //Output --> { name: 'Mango Tea', caffine: 'No', tasty: 'Yes' }






PROS AND CONS




  • Pros is that it is fast, native and correctly handles Date ,RegExp ,maps and circular references.

  • Cons is that it is will throw error when an object contain function or DOM nodes.








  • Using JSON.parse(JSON.stringify()):
    Before structuredClone() developers uses this trick to create a deep copy of object. It converts the object into a JSON string, then parse it back into brand-new object.




const original = { name: "Yo!!", nested: { id: 12 } };

const clone = JSON.parse(JSON.stringify(original));






Why we should not use it?

The method strips out the data type that are not supported by JSON. IF your object contains date , undefined , Null, Map, Set , or Infinity, they would either be lost or may be get corrupted or the value can be converted to NULL.






This is all about Deep Copy and Shallow Copy. Hope this gets you how and when to use shallow and deep copy method. JavaScript is full of such twist and turns.

Information ergänzen Fachhinweis, Update, Korrektur oder Quelle zur Meldung beitragen
Gäste-Hinweise werden kurz redaktionell geprüft und danach hier angezeigt.

Community-Hinweise zur Meldung

0 freigegeben
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!
Informations-Bewertung:

💬 Debate de la comunidad y comentarios

🌐 Unirse al chat principal

Inicia el debate en el stream de difusión del Social Chat o envía arriba una contribución experta mediante el formulario de ampliación.

Valoración de la comunidad & prueba social
⭐ Valoración de los lectores
–
Ø / 5.0
Aún no hay valoraciones de lectores
¿Le ha resultado útil este artículo?
0
Dejar una valoración ahora
Valoración detallada (opcional)
Contenido & calidad
Fuente & credibilidad
Actualidad
Briefing de seguridad Gratis · baja en 1 clic

Intelligence Digest — gratis

Cada día las noticias de seguridad más importantes · baja en cualquier momento

Clústeres de historias relacionados & fuentes (IA vectorial)

6 Cluster
25 fuentes
ForgeOS Booted on a Real Server: Linux Kernel Below, Only Our Own Code Above
DEV Community hace 1 h
24 fuentes más
VulDB Updateshace 2 hCVE-2026-72239 | Linux Kernel sev x86/virt/sev/sev.c wbinvd_on_all_cpus state issue (WID-SEC-2026-2852) VulDB Updateshace 2 hCVE-2026-72240 | Linux Kernel up to 7.1.4 mfd sm501_register_device memory leak (WID-SEC-2026-2852) VulDB Updateshace 2 hCVE-2026-72241 | Linux Kernel up to 7.1.4 uleds strchr buffer overflow (WID-SEC-2026-2852) VulDB Updateshace 2 hCVE-2026-72244 | Linux Kernel up to 6.12.100/6.18.41/7.1.4/7.2-rc2 gpu-buddy allocation of resources (WID-SEC-2026-2852) VulDB Updateshace 2 hCVE-2026-72243 | Linux Kernel up to 7.2-rc2 selinux socket_sendmsg permission (Nessus ID 364200 / WID-SEC-2026-2852) VulDB Updateshace 2 hCVE-2026-72245 | Linux Kernel up to 7.1.4 host1x host1x_device_parse_dt release of resource (WID-SEC-2026-2852) VulDB Updateshace 2 hCVE-2026-72246 | Linux Kernel flowtable input validation (WID-SEC-2026-2852) VulDB Updateshace 2 hCVE-2026-72247 | Linux Kernel up to 7.2-rc3 nf_conncount __nf_conncount_add dir comparison (WID-SEC-2026-2852) VulDB Updateshace 2 hCVE-2026-72248 | Linux Kernel up to 7.1.4/7.2-rc2 flowtable nft_flow_dst_release buffer overflow (WID-SEC-2026-2852) LinuxAndUbuntuhace 2 hLinux AutoFDO Benchmark: Clang Kernel Optimization FOSS Linuxhace 2 hNFS2ROOT: Pre-Auth Flaw in the Linux NFS Server VulDB Updateshace 3 hCVE-2022-31607 | NVIDIA GPU Display Driver on Linux Kernel Mode Layer nvidia.ko input validation (EUVD-2022-53059 / Nessus ID 339047) VulDB Updateshace 4 hCVE-2026-72227 | Linux Kernel up to 6.12.96/6.18.39/7.1.4/7.2-rc2 batman-adv out-of-bounds (WID-SEC-2026-2852) VulDB Updateshace 4 hCVE-2026-72228 | Linux Kernel up to 7.2-rc2 batman-adv skb_split memory leak (WID-SEC-2026-2852) VulDB Updateshace 4 hCVE-2026-72229 | Linux Kernel up to 7.2-rc2 batman-adv register_netdevice memory leak (WID-SEC-2026-2852) VulDB Updateshace 4 hCVE-2026-72231 | Linux Kernel up to 7.2-rc2 batman-adv batadv_send_tt_request allocation of resources (WID-SEC-2026-2852) VulDB Updateshace 4 hCVE-2026-72230 | Linux Kernel up to 7.2-rc2 batman-adv batadv_frag_send_packet memory leak (WID-SEC-2026-2852) VulDB Updateshace 4 hCVE-2026-72232 | Linux Kernel up to 7.2-rc2 batman-adv batadv_interface_tx out-of-bounds (WID-SEC-2026-2852) VulDB Updateshace 4 hCVE-2026-72234 | Linux Kernel up to 7.2-rc1 batman-adv batadv_get_vid use after free (WID-SEC-2026-2852) VulDB Updateshace 4 hCVE-2026-72233 | Linux Kernel up to 7.2-rc1 batman-adv batadv_bla_is_backbone_gw use after free (WID-SEC-2026-2852) VulDB Updateshace 4 hCVE-2026-72236 | Linux Kernel up to 7.2-rc3 s390/perf_cpum_cf __hw_perf_event_init config array index (WID-SEC-2026-2852) VulDB Updateshace 4 hCVE-2026-72235 | Linux Kernel up to 7.2-rc1 batman-adv batadv_interface_rx use after free (WID-SEC-2026-2852) VulDB Updateshace 4 hCVE-2026-72237 | Linux Kernel up to 7.2-rc2 BRS /x86/amd/brs amd_brs_match_plm information disclosure (WID-SEC-2026-2852) VulDB Updateshace 4 hCVE-2026-72238 | Linux Kernel up to 7.2-rc3 x86 boot early_serial_init integer overflow (WID-SEC-2026-2852)
14 fuentes
Cyber Monday Australia laptop deals for 2026: score up to 52% off Lenovo, Apple, Dell, HP and more
Latest from TechRadar hace 13 min.
13 fuentes más
Artículos similares
🔍 Verwandte News

Auch interessante Nachrichten Shallow Copy VS Deep Copy In Java Script : Explained in easiest way

Thematisch verwandte Begriffe: Shallow, Copy, Deep, Java · 6 Treffer

Laden...

Cargando vídeos ...

Laden...

Cargando artículos ...

Laden...

Cargando vídeos ...

Laden...

Cargando artículos ...

Laden...

Cargando vídeos ...

Laden...

Cargando artículos ...

Laden...

Cargando vídeos ...

Laden...

Cargando artículos ...

Laden...

Cargando vídeos ...

💬 Cargando comentarios…
Desliza para actualizar
Widgets & temas
Cargando widgets…
Siguiente entrada