Zum Hauptinhalt springen
LIVE
CVSS 7.0CVE-2026-138158 | libgphoto2 through 2.5.34 contains a stack buffer overflow in sierra_get_string_register() that lets a malicious sierra-protocol camera or USB device overwrite stack memory. When files are listed, the device can answer the file-name register with an oversized packet, writing up to 32 KB past small stack buffers to cause crashes or possible code execution.CVSS 7.7CVE-2026-138159 | edbrowse through 3.8.19 contains an integer overflow in stringAndBytes() that allows malicious servers to write past a heap buffer by sending response bodies larger than 2 GB. When a user browses to an attacker-controlled HTTP, FTP, or gopher server, the oversized body skips reallocation and corrupts the heap, causing crashes or potentially code execution.CVSS 8.5CVE-2026-138160 | Gammu before 1.45.2 contains a stack-based buffer overflow vulnerability in ReadBackupTextLen() that allows attackers to overwrite stack memory via crafted backup files. Attackers can supply overlong quoted text values decoded into a 10,000-byte stack array during convertbackup, restore, or GSM_ReadBackupFile calls, causing crashes or potential code execution.CVSS 8.5CVE-2026-138161 | Gammu before 1.45.2 contains a buffer overflow vulnerability in LoadBackup() that allows attackers to corrupt memory by supplying an overlong MD5 value in a crafted backup file. Attackers can overwrite adjacent phonebook and calendar entry pointers via strcpy() into MD5Original when files are loaded with convertbackup or restore, causing crashes or potential code execution.CVSS 7.3CVE-2026-138162 | Gammu before 1.45.2 contains a stack-based buffer overflow vulnerability in ALCATEL_EncodeString() that allows attackers to overwrite stack memory via oversized encoded phonebook text. Attackers can supply a crafted backup restored with gammu restore or addnew to an attached Alcatel phone, using GSM extension characters to crash Gammu or potentially execute code.CVSS 8.5CVE-2026-138163 | Gammu before 1.45.2 contains a heap-based buffer overflow in ReadWAPSettingsEntry() that allows attackers to corrupt heap memory via crafted backup files with excess WAP or MMS settings entries. Attackers can supply a backup with more than four TitleNN keys in a [WAPSettings] or [MMSSettings] section, loaded via convertbackup, restore, or GSM_ReadBackupFile, causing crashes or potential code execution.CVSS 4.8CVE-2026-138164 | Gammu before 1.45.2 contains a stack-based buffer overflow vulnerability in SaveBackupText() in backtext.c that allows attackers to corrupt stack memory by supplying long text fields. Attackers can craft a backup with long calendar or note fields that, when converted with gammu convertbackup, writes hex digits past the 10,000-byte stack buffer.CVSS 9.3CVE-2026-138154 | POSTAL 2 before build 26810491 contains a sandbox escape vulnerability that allows malicious Steam Workshop mods to execute code by calling ConsoleCommand with a start file URI. Attackers can ship a batch file in a mod at the predictable workshop install path and launch it via ShellExecuteW, executing commands as the player on Windows.
Alle im Drawer
Intelligence View
⚡ tsecurity.de Intelligence

Why Functional Code Can Be Slower

Functional Programming has a marketing problem. Or perhaps more accurately: Functional Programming has a reality problem. If you spend enough time reading…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Quelle & Fakten · 6 Min. Lesezeit
Quelle: dev.to
Rubrik: Sichere Programmierung

Functional Programming has a marketing problem.



Or perhaps more accurately:



Functional Programming has a reality problem.



If you spend enough time reading articles about FP, you'll eventually encounter claims like:




More elegant

More composable

More predictable

More maintainable






And honestly?



Many of those claims are true.



I use functional patterns regularly.



I enjoy them.



I write about them.



This entire article series has been exploring concepts like:




  • Reduce

  • Transducers

  • Functors

  • Monads

  • RxJS

  • Event Sourcing



But there is a topic that rarely gets discussed honestly:




Functional code can be slower.




Sometimes dramatically slower.



And understanding why makes you a better engineer.



Because performance doesn't care how elegant your abstractions are.









The Myth



Many developers unconsciously assume:




More Functional
=
More Modern
=
More Efficient






This is not true.



Consider:




const usersById =
users.reduce(
(acc, user) => ({
...acc,
[user.id]: user
}),
{}
)






Looks elegant.



Looks immutable.



Looks functional.



But it can also be incredibly expensive.



Why?



Because every iteration creates a brand-new object.









What Actually Happens



Suppose:




{
a: 1,
b: 2
}






becomes:




{
...obj,
c: 3
}






JavaScript doesn't magically update the object.



It creates:




New Object
+
Copy Existing Properties
+
Add New Property






Every time.



Now imagine:




10000






iterations.



You aren't just doing:




10000 writes






You're doing:




Thousands of object copies






which is a completely different cost.









The Loop Version



Compare:




const usersById = {}

for (const user of users) {
usersById[user.id] = user
}






This mutates one object.



No copies.



No allocations.



No repeated spreads.



From a performance perspective:




The loop wins.






Almost every time.









Functional Doesn't Mean Free



Consider:




const result = users
.map(transformA)
.map(transformB)
.map(transformC)






Looks clean.



But internally:




Array
↓
Array
↓
Array
↓
Array






Each map creates a new collection.



For:




100






items?



Nobody cares.



For:




1000000






items?



You probably should.









The Hidden Cost Of Immutability



One of the biggest performance tradeoffs in FP is immutability.



Example:




return {
...state,
count: state.count + 1
}






versus:




state.count += 1
return state






The immutable version:




  • Allocates memory

  • Copies properties

  • Creates garbage



The mutable version:




  • Updates in place



Much cheaper.









Garbage Collection Is Not Free



Most performance discussions stop at CPU.



But memory matters too.



Every allocation creates work for:




Garbage Collector






Consider:




array
.map(...)
.filter(...)
.map(...)
.flatMap(...)






Each stage may create:




Temporary Objects
Temporary Arrays
Temporary Closures






Eventually:




GC Pause






must clean them.









Closures Have A Cost



Every callback:




x => x * 2






creates machinery.



Modern engines optimize aggressively.



But optimization is not magic.



Compare:




for (let i = 0; i < len; i++) {
result[i] = data[i] * 2
}






with:




data.map(
x => x * 2
)






The difference is often small.



But it exists.



And at scale:



Small differences accumulate.









Why Transducers Exist



Remember our Transducers article?



This problem is exactly why Transducers were invented.



Without Transducers:




data
.filter(...)
.map(...)
.filter(...)
.map(...)






Multiple passes.



Multiple arrays.



Multiple allocations.



With Transducers:




Single Pass
Single Reduction
No Intermediate Arrays






Same functionality.



Much better memory behavior.









Why RxJS Often Feels Fast



This surprises people.



RxJS can sometimes outperform traditional collection processing.



Why?



Because:




One Value
At A Time






Instead of:




Entire Collection






The pipeline processes:




Value
↓
Transform
↓
Next Value






Memory remains stable.









The V8 Factor



Modern JavaScript engines are incredibly smart.



But they have expectations.



For example:




{
id: 1,
name: "John"
}






and:




{
name: "John",
id: 1
}






may not be treated identically internally.



Hidden classes.



Inline caches.



Object shapes.



All influence performance.



Repeated object spreading can interfere with these optimizations.









Performance Is A Tradeoff



The mistake many developers make is assuming:




Readable
vs
Fast






is a binary choice.



It isn't.



Most systems spend their lives here:




Readable Enough
Fast Enough






That's the sweet spot.









A Practical Rule



For:




Small datasets
Normal APIs
Typical UI code






Choose clarity.



Always.



Nobody wins awards for micro-optimizing:




50






items.









When Performance Starts Mattering



Pay attention when:




Large datasets

Real-time processing

Streaming systems

Analytics

Data pipelines

Rendering loops






appear.



Now those abstractions become measurable.









The Most Expensive Functional Pattern



This pattern:




array.reduce(
(acc, item) => ({
...acc,
[item.id]: item
}),
{}
)






is probably responsible for more accidental JavaScript slowdowns than any other FP pattern.



It looks elegant.



It benchmarks terribly.









The Most Important Performance Lesson



Many developers ask:




Which is faster?

reduce()
or

for...of






Wrong question.



The real question is:




What work is being done?






Because:




reduce()






with mutation:




users.reduce(
(acc, user) => {
acc[user.id] = user
return acc
},
{}
)






is very different from:




users.reduce(
(acc, user) => ({
...acc,
[user.id]: user
}),
{}
)






Same API.



Very different performance characteristics.









Pros Of Functional Code






1. Easier Composition



Functions combine naturally.









2. Easier Testing



Pure functions are predictable.









3. Better Abstractions



Patterns become reusable.









4. Less Shared Mutable State



Fewer side effects.









5. Better Reasoning



State transitions become explicit.









Cons Of Functional Code






1. More Allocations



Especially with immutable updates.









2. More Garbage Collection



Temporary objects accumulate.









3. Callback Overhead



Functions are not free.









4. Intermediate Collections



Repeated map/filter chains create extra work.









5. Can Hide Performance Problems



Elegant code often disguises expensive operations.









The Real Lesson



The biggest mistake developers make is turning programming paradigms into religions.



Functional Programming isn't better.



Object-Oriented Programming isn't better.



Procedural Programming isn't better.



They're tools.



And every tool has tradeoffs.



Functional patterns give us:




Composability

Predictability

Maintainability






But sometimes they cost:




Memory

CPU

Allocations






The best engineers understand both sides.



They know when to reach for:




map()
reduce()
flatMap()






And they know when a simple:




for...of






is exactly the right solution.



Because ultimately:




The goal isn't writing the most functional code.




The goal is writing the right code.









What's Next?



In the next article we'll discuss:




When a for...of Loop Is Better Than reduce()




Because after spending multiple articles exploring the power of reduce(), it's time to answer a question many developers quietly wonder:




Should I even be using reduce here?






And surprisingly often, the answer is:




No.












About The Author



Hi, I'm Amrish Khan.



I enjoy building developer tools, exploring software architecture, and writing about the deeper ideas behind everyday programming concepts.



I'm also building Aruvix — a growing ecosystem of local-first developer tools designed to process data directly in the browser without unnecessary uploads.



Here's a detailed blog on Aruvix:



https://dev.to/amrishkhan05/aruvix-the-ultimate-offline-first-developer-toolkit-e0i



You can follow my work and thoughts here:



Portfolio:

https://www.amrishkhan.dev



LinkedIn:

https://www.linkedin.com/in/amrishkhan



GitHub:

https://www.github.com/amrishkhan05



If you enjoyed this article, consider following for more deep dives into JavaScript, architecture, local-first software, and performance engineering.

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:

💬 Topluluk tartışması ve yorumlar

🌐 Ana sohbete katıl

Tartışmayı başlat: Social Chat yayın akışı veya yukarıdaki ekleme formuyla uzman katkısı gönder.

Siber Tehdit İstihbaratı ve Adli Bilişim

ATT&CK Gezgini · IoC Radarı ve Graf

IoC Intelligence
1 Indikatoren · Defanged · STIX 2.1
dev[.]to
CTI Threat Relationship Graph
Akteure · Techniken · Beziehungen
2 Knoten · 1 Relationen
CVE / Incident Threat Actor Software MITRE ATT&CK CWE Weakness IoC
Community Rating &amp; Social Proof
⭐ Okuyucu Puanı
–
Ø / 5.0
Hiçbir okuyucu henüz yorum yok
Bu makale yararlı mıydı?
0
Değerlendirmenizi gönderin
Detaylı değerlendirme (isteğe bağlı)
İçerik ve Kalite
Kaynak ve Güvenilirlik
Güncellik
Security Briefing Ücretsiz · Tek tıkla abonelikten çıkma

Zeka Digest - ücretsiz

Günlük en önemli güvenlik haberi · herhangi bir zamanda alınabilir

İlgili Story Cluster & Kaynaklar (vector AI)

1 Cluster
2 Kaynaklar
GrapheneOS: Proof of Concept für RCS-Messenger ohne Google Messages
tsecurity.de 1 gün önce
1 başka bir kaynak
Benzer katkılar
🔍 Verwandte News

Auch interessante Nachrichten Why Functional Code Can Be Slower

Thematisch verwandte Begriffe: Functional, Code, Slower · 6 Treffer

Laden...

Videolar yükleniyor...

Laden...

Contributions yüklenir ...

Laden...

Videolar yükleniyor...

Laden...

Contributions yüklenir ...

Laden...

Videolar yükleniyor...

Laden...

Contributions yüklenir ...

Laden...

Videolar yükleniyor...

Yorumlar yüklenir..
Update to Update
Widgets & Topics
Loading widgets…
Nächster Beitrag