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

Beyond TTL: Explicit Cache Invalidation

Most engineers default to TTL for cache invalidation. But a simple Time-To-Live guarantees stale reads for a duration, which is unacceptable for critical data…

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

Most engineers default to TTL for cache invalidation. But a simple Time-To-Live guarantees stale reads for a duration, which is unacceptable for critical data that demands immediate read-after-write consistency.



Relying solely on TTL can lead to frustrating production outages and customer trust issues. Imagine a user updating their profile picture, only for their friends to see the old one for another five minutes. Or worse, a customer sees their bank balance after a transfer and it shows the old amount, leading them to believe the transaction failed. These aren't edge cases; they're common failures when caching is poorly integrated with data updates, directly impacting user experience and potentially costing real money.






Beyond TTL: Explicit Cache Invalidation



For data that demands read-after-write consistency, you cannot rely on a probabilistic, time-based expiry. You need explicit invalidation. The application must actively remove or update a cache entry whenever the underlying data changes in the source of truth (typically a database).



The most robust and common pattern is "Cache Aside with explicit invalidation." Here’s the flow:




  1. Read: Application tries to read data from the cache.


    • Cache Hit: Return data immediately.

    • Cache Miss: Application reads data from the database, stores it in the cache, then returns it.



  2. Write (Update/Delete): Application writes (updates or deletes) data directly to the database.

  3. Invalidate: Immediately after the successful database write, the application explicitly deletes the corresponding entry from the cache. This ensures the next read will be a cache miss, fetching the fresh data from the database.



This strategy ensures that any subsequent read after a write will either hit an empty cache (triggering a fresh database read) or hit a cache that still holds the old value briefly until the invalidation propagates. For true read-after-write consistency, the invalidation must happen before any subsequent read.



Here's an ASCII diagram for a single application instance interacting with a single cache instance:




+--------+      +----------+      +----------+
| Client | <--> | App | <--> | Database |
+--------+ +----------+ +----------+
| ^
| | (1. Cache Miss -> Read DB)
v | (2. Store in Cache)
+-----+
|Cache|
+-----+
^
| (3. Invalidate on Write)






In a distributed system with multiple application instances and multiple cache nodes (e.g., a Redis cluster or a Memcached fleet), explicit invalidation becomes more complex. You can't just delete from one cache node; you need to ensure all relevant cache nodes invalidate that entry. This is typically handled via a distributed messaging system (like Kafka, RabbitMQ, or Redis Pub/Sub) or by making the cache invalidation a part of a distributed transaction or event stream.




+--------+      +----------+      +----------+
| Client | <--> | App 1 | <--> | Database |
+--------+ +----------+ +----------+
| ^ |
| | | (DB Write)
v | v
+-----+ +----------------+
|Cache| | Invalidation |
| Node| <------- | Message Bus |
| A | | (e.g., Kafka) |
+-----+ +----------------+
^ ^
| |
| (Publishes invalidation)
| | (Subscribes to invalidation)
v v
+-----+ +-----+
|Cache| |Cache|
| Node| <------- | Node|
| B | | C |
+-----+ +-----+






When App 1 writes to the database, it also publishes an invalidation message (e.g., "invalidate key 'user:123'") to the Message Bus. All cache nodes, or services that manage cache nodes, subscribe to this bus and delete the specific key from their local cache. This ensures eventual consistency across cache replicas for invalidation, which is typically fast enough (tens of milliseconds latency for most message buses).






Uber's Profile Service Invalidation



Consider Uber's profile service. When a driver updates their vehicle registration or a rider changes their payment method, this critical information needs to be instantly consistent across various downstream services (e.g., matching engine, billing, support).



Uber likely employs a pattern similar to "Cache Aside with explicit invalidation" for such high-priority data. When a write occurs to the underlying persistent storage (e.g., a sharded MySQL database or a NoSQL store), the service responsible for that write explicitly invalidates the relevant key in their distributed cache (e.g., a massive Redis cluster). This invalidation isn't just a local operation; it's propagated across regions and cache replicas.



For example, a Profile Update Service might:




  1. Persist data to MySQL (typically takes 5-10ms).

  2. On successful commit, publish an event to a Kafka topic like profile_updates (adds <1ms to latency for publishing).

  3. A dedicated Cache Invalidation Service (or individual services with their own caches) subscribes to profile_updates.

  4. Upon receiving an event for user:123, it issues a DELETE user:123 command to the Redis cluster (typically <1ms for a local delete).



This ensures that within tens of milliseconds, even across geographically dispersed data centers, stale data is purged from caches. For reads hitting other services, if they cache user profiles, they also subscribe to the profile_updates topic, ensuring they too invalidate their local caches. This pattern helps Uber achieve a consistently high cache hit ratio (>95%) for frequently accessed data while guaranteeing strong read-after-write consistency for critical updates.






Common Mistakes




  1. Assuming TTL is enough for everything. TTL is great for less critical data where eventual consistency is acceptable (e.g., trending topics, non-essential recommendations). But for user-generated content, financial data, or critical configuration, TTL is a recipe for stale data and customer complaints. Engineers often apply a blanket TTL policy without differentiating data consistency needs.

  2. Forgetting about Race Conditions during invalidation. A classic race condition:


    • App writes to DB.

    • App tries to invalidate cache.

    • Before invalidation happens, another App instance reads from the cache, gets old data, and stores it back in the cache (if it's a "miss and populate" strategy, or if the invalidation fails).

    • The initial App instance successfully invalidates.

    • Result: the cache now contains the old data again.
      The safest way to avoid this is to DELETE from cache after a successful DB write, and if a read hits a stale cache before invalidation, it will get stale data once. The subsequent read will correctly fetch fresh data. To mitigate the race, some systems use a "delete-then-write" pattern, but this can lead to temporary cache misses and increased DB load. A more robust solution involves versioning (e.g., write data to cache with a version, only update if versions match or newer) or ensuring cache writes are atomic with DB writes (e.g., transactional outbox pattern).



  3. No retry mechanism for invalidation. Network issues, cache server failures, or transient errors can cause an invalidation request to fail. If your application doesn't retry invalidation, the cache will remain stale indefinitely, leading to hard-to-debug issues. Always build in retry logic with exponential backoff for cache operations.

  4. Blindly invalidating everything. When a complex object changes, some engineers invalidate the entire object or even all related objects. This can lead to a drastic drop in cache hit ratio, increased load on the database, and degraded performance. Design your cache keys and invalidation strategy to be as granular as possible. If only a small field within a large user profile changes, invalidate only that specific user's profile, not all profiles.






Interview Angle



When an interviewer asks about caching, especially about invalidation, they're looking for your understanding of consistency models and practical trade-offs beyond simple TTL.



Common Follow-up Questions:




  • "How do you achieve read-after-write consistency in a distributed cache?"


    • Strong Answer: "We'd use a 'Cache Aside' pattern. On a write, the application first updates the database and then explicitly invalidates (deletes) the relevant key from the cache. This forces the next read to go to the database, ensuring fresh data. For distributed caches, this invalidation would be propagated via a message bus like Kafka or Redis Pub/Sub to all relevant cache nodes or services."



  • "What if the cache invalidation fails?"


    • Strong Answer: "This is a critical failure scenario. The application must implement robust retry logic with exponential backoff for cache invalidation operations. If a retry still fails after several attempts, we'd log the error, alert monitoring systems, and potentially revert to a TTL for that specific key as a fallback, understanding the temporary consistency trade-off. For extremely critical data, you might even consider a transactional outbox pattern where the DB write and cache invalidation message are part of an atomic transaction."



  • "How do you handle this with multiple cache replicas/regions?"


    • Strong Answer: "We'd use a publish/subscribe mechanism. The service performing the write publishes an invalidation event to a message queue (e.g., Kafka). All cache instances (or cache management services) in different regions or data centers subscribe to this queue and, upon receiving the event, explicitly delete the corresponding key from their local cache. This ensures eventual consistency for cache invalidation across the distributed system, typically within tens of milliseconds."



  • "What are the trade-offs of explicit invalidation vs. TTL?"


    • Strong Answer: "Explicit invalidation offers strong read-after-write consistency, crucial for critical data, but adds complexity to the write path (extra cache operation, retry logic, distributed messaging). It also demands careful key management. TTL is simpler to implement, requires less write path complexity, and is suitable for data where eventual consistency is acceptable. However, it guarantees stale reads for the TTL duration and is prone to unnoticed consistency issues for frequently updated data. The choice depends on the data's consistency requirements and performance profile."





Need help refining your system design skills or tackling specific interview challenges? Book a 1:1 session with me on Topmate to deep dive into advanced topics and real-world system architectures.









Want to Go Deeper?



I do 1:1 sessions on system design, backend architecture, and interview prep.

If you're preparing for a Staff/Senior role or cracking FAANG rounds — book a session here.

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:

💬 Community-Diskussion & Kommentare

🌐 Zum Hauptchat

Starte die Diskussion im Social-Chat Broadcast Stream oder reiche oben über „Information ergänzen“ einen Fachbeitrag ein.

Cyber Threat Intelligence & Forensik

ATT&CK-Navigator · IoC-Radar & Graph

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
⭐ Leser-Wertung
–
Ø / 5.0
Noch keine Leser-Bewertungen
War dieser Artikel hilfreich?
0
Jetzt Bewertung abgeben
Detail-Bewertung (optional)
Inhalt & Qualität
Quelle & Glaubwürdigkeit
Aktualität
Security Briefing Kostenlos · 1-Klick-Abmeldung

Intelligence Digest — kostenlos

Täglich die wichtigsten Security-News · jederzeit abbestellbar

Verwandte Story-Cluster & Quellen (Vektor-KI)

6 Cluster
26 Quellen
ForgeOS Booted on a Real Server: Linux Kernel Below, Only Our Own Code Above
DEV Community vor 1 Std.
25 weitere Quellen
VulDB Updatesvor 2 Std.CVE-2026-72239 | Linux Kernel sev x86/virt/sev/sev.c wbinvd_on_all_cpus state issue (WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72240 | Linux Kernel up to 7.1.4 mfd sm501_register_device memory leak (WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72241 | Linux Kernel up to 7.1.4 uleds strchr buffer overflow (WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-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 Updatesvor 2 Std.CVE-2026-72243 | Linux Kernel up to 7.2-rc2 selinux socket_sendmsg permission (Nessus ID 364200 / WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72245 | Linux Kernel up to 7.1.4 host1x host1x_device_parse_dt release of resource (WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72246 | Linux Kernel flowtable input validation (WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72247 | Linux Kernel up to 7.2-rc3 nf_conncount __nf_conncount_add dir comparison (WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72248 | Linux Kernel up to 7.1.4/7.2-rc2 flowtable nft_flow_dst_release buffer overflow (WID-SEC-2026-2852) LinuxAndUbuntuvor 2 Std.Linux AutoFDO Benchmark: Clang Kernel Optimization FOSS Linuxvor 2 Std.NFS2ROOT: Pre-Auth Flaw in the Linux NFS Server VulDB Updatesvor 3 Std.CVE-2022-31607 | NVIDIA GPU Display Driver on Linux Kernel Mode Layer nvidia.ko input validation (EUVD-2022-53059 / Nessus ID 339047) VulDB Updatesvor 4 Std.CVE-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 Updatesvor 4 Std.CVE-2026-72228 | Linux Kernel up to 7.2-rc2 batman-adv skb_split memory leak (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72229 | Linux Kernel up to 7.2-rc2 batman-adv register_netdevice memory leak (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72231 | Linux Kernel up to 7.2-rc2 batman-adv batadv_send_tt_request allocation of resources (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72230 | Linux Kernel up to 7.2-rc2 batman-adv batadv_frag_send_packet memory leak (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72232 | Linux Kernel up to 7.2-rc2 batman-adv batadv_interface_tx out-of-bounds (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72234 | Linux Kernel up to 7.2-rc1 batman-adv batadv_get_vid use after free (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72233 | Linux Kernel up to 7.2-rc1 batman-adv batadv_bla_is_backbone_gw use after free (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-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 Updatesvor 4 Std.CVE-2026-72235 | Linux Kernel up to 7.2-rc1 batman-adv batadv_interface_rx use after free (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72237 | Linux Kernel up to 7.2-rc2 BRS /x86/amd/brs amd_brs_match_plm information disclosure (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72238 | Linux Kernel up to 7.2-rc3 x86 boot early_serial_init integer overflow (WID-SEC-2026-2852) DEV Communityvor 4 Std.Is that GPTBot real? How to verify Googlebot, Bingbot and AI crawlers in your server logs
14 Quellen
Amazon Australia Cyber Monday deals
Latest from TechRadar vor 38 Min.
13 weitere Quellen
CNETvor 47 Min.This Pocket Battery Recharges Your Phone 4 Times, and it’s Only $38 for Cyber Monday Latest from TechRadarvor 1 Std.Firebat's M1 is a cracking Ryzen AI 9 HX 470 mini PC for AI workloads — and it's packing OCuLink, 32GB of RAM, and a 1TB SSD for $1020 this Cyber Monday Latest from TechRadarvor 1 Std.The Lenovo IdeaCentre Tower Copilot+ PC with Core Ultra 7 CPU isn't discounted for Cyber Monday — and it's still the desktop computer I'd buy for work for $1049 The Vergevor 1 Std.Qobuz is my streaming service of choice and it’s on sale during Cyber Monday CNETvor 12 TagenThis Paramount Plus Cyber Monday Deal Gets You Ad-Free Viewing for Only $3 Per Month CNETvor 1 Std.Cyber Monday Meta Quest 3S Deal Knocks $53 Off and Gets You $50 Free Amazon Credit WIREDvor 4 Std.The 31+ Very Best Amazon Black Friday Deals (2026): Up to 50% Off The Vergevor 2 Std.These early Cyber Monday gaming laptop deals offer the most GPU for the least money Latest from TechRadarvor 3 Std.Grab a TP-Link dual-band Wi-Fi 6 router with 1.5Gbps for $44 this Cyber Monday CNETvor 4 Std.Upgrade Your Emergency Preparedness Kit With Black Friday and Cyber Monday Deals on Power Stations, Flashlights, Solar and More AppleInsider Newsvor 4 Std.AirPods Max 2 plunge to best $399 price with $150 Cyber Monday discount Latest from TechRadarvor 4 Std.I test Apple TV VPNs for a living — here are the 3 VPNs worth your money for Black Friday and Cyber Monday WIREDvor 4 Std.Cyber Monday Deals, Curated Live By Our Experts (2026)
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Beyond TTL: Explicit Cache Invalidation

Thematisch verwandte Begriffe: Beyond, Explicit, Cache, Invalidation · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Widgets & Themen
Widgets werden geladen…
Nächster Beitrag