Zum Hauptinhalt springen
LIVE
CVSS 7.4CVE-2026-138376 | AsyncSSH 1.13.1 before 2.24.2 contains an improper authentication vulnerability in SSHConnection._match_known_hosts that accumulates trusted client host keys across host-based authentication attempts on one connection. With trust_client_host enabled, attackers holding one known client host's private key can retry naming another known host and log in as users authorized only from that host.CVSS 7.6CVE-2026-138377 | AsyncSSH 1.13.1 before 2.24.2 contains an improper certificate validation vulnerability that allows remote clients to authenticate as users by abusing X.509 certificates matched in known_client_hosts. Attackers can make a failed host-based authentication attempt with any host key, adding host-only CA certificates to the trust anchors, then authenticate using user certificates issued under those CAs.CVSS 9.1CVE-2026-138378 | react-native-pure-jwt before 3.1.1 on Android contains a signature verification bypass vulnerability that allows unauthenticated attackers to forge tokens because RNPureJwtModule decode() calls JJWT parse() without algorithm pinning. Attackers can craft a token with header alg none and an empty signature to have arbitrary claims accepted as verified, forging identities or roles.CVSS 6.9CVE-2026-138379 | flare-redact before 1.13.1 contains a redaction bypass vulnerability that leaks secrets because the redact() object walker masks sensitive keys only when values are strings. Numbers, objects, arrays and binary data under keys such as password, cvv, pin, cookie or authorization pass through unchanged, exposing secrets in clear text to logger, Sentry, gateway and Fluent Bit sinks.CVSS 6.9CVE-2026-138380 | MediaInfoLib before 26.10 contains a heap-based buffer over-read vulnerability in File_Ogg::Data_Parse() that allows attackers to read beyond heap buffers via crafted Ogg segment sizes. Attackers can supply an Ogg file whose segment sizes exceed the page payload, wrapping the unsigned offset check and causing memcpy over-reads that crash the process or leak heap memory.CVSS 6.9CVE-2026-138381 | GNU LibreDWG 0.14 before 0.15 contains a heap use-after-free vulnerability in in_dxf.c new_object() where the OLE2FRAME oleclient pointer references freed memory after DXF import. Attackers can supply a DXF file with an OLE2FRAME entity to crash dxfwrite or similar applications and leak freed heap contents into exported output.CVSS 10.0CVE-2026-138227 | A vulnerability was found in D-Link R95 1.04B04Beta. This affects the function SetTimeSettings of the file /bin/ssi of the component DHMAPI. Performing a manipulation of the argument TZLocation results in os command injection. Remote exploitation of the attack is possible. The exploit has been made public and could be used.CVSS 10.0CVE-2026-138226 | A vulnerability has been found in D-Link R95 1.04B04Beta. Affected by this issue is the function SetSecureDNSSettings of the file /bin/ssi of the component DHMAPI SOAP interface. Such manipulation of the argument URI leads to os command injection. The attack may be launched remotely. The exploit has been disclosed to the public and may be used.
Alle im Drawer
Intelligence View
⚡ tsecurity.de Intelligence

Debugging Go With Delve: Beyond fmt.Println

Book: The Complete Guide to Go Programming Also by me: Hexagonal Architecture in Go — the companion book in the Thinking in Go series My project: Hermes IDE | G…

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





You know the loop. A test fails on the third goroutine out of

fifty. You sprinkle fmt.Println("here", x) through the code,

run it, read the wall of output, add three more prints, run it

again. Twenty minutes later you have found the bug and left a

minefield of debug lines you have to clean up before you commit.



Go has a real debugger, and it was built by people who work on

Go. Delve understands

goroutines, the Go runtime, and Go's calling conventions in a way

that GDB never did. This is a tour of the four things that make it

worth the muscle memory: breakpoints, conditional breakpoints,

goroutine inspection, and attaching to a process that is already

running.





Getting Delve



Install the dlv binary with go install:




// from your shell, not a .go file
go install github.com/go-delve/delve/cmd/dlv@latest






Check it works:




dlv version






Delve builds your program with optimizations and inlining turned

off (-gcflags="all=-N -l") so the line numbers and variables

match your source. You do not pass those flags yourself; dlv

does it for you.



The example we will debug is small on purpose: a worker pool that

processes orders and, on one specific order, does the wrong thing.

Here is the whole program we will run under Delve.




package main

import (
"fmt"
"sync"
)

type Order struct {
ID int
Total int
}

func process(o Order) int {
fee := o.Total / 10
if o.ID == 37 {
fee = fee * -1 // the planted bug
}
return o.Total + fee
}

func main() {
orders := make([]Order, 0, 50)
for i := 0; i < 50; i++ {
orders = append(orders, Order{ID: i, Total: 100})
}

var wg sync.WaitGroup
results := make([]int, len(orders))
for i, o := range orders {
wg.Add(1)
go func(idx int, ord Order) {
defer wg.Done()
results[idx] = process(ord)
}(i, o)
}
wg.Wait()
fmt.Println("total:", sum(results))
}

func sum(xs []int) int {
t := 0
for _, x := range xs {
t += x
}
return t
}









Breakpoints



Start a debug session on the package in the current directory:




dlv debug






That drops you at a (dlv) prompt with the program compiled but

not started. Set a breakpoint on the process function:




(dlv) break process
Breakpoint 1 set at 0x... for main.process() ./main.go:14






You can also break on a file and line, which is what you reach for

most of the time:




(dlv) break main.go:16






Now run until the first hit:




(dlv) continue






Execution stops at the breakpoint. Look at what you have:




(dlv) args
o = main.Order {ID: 0, Total: 100}
(dlv) print o.Total
100
(dlv) next
(dlv) locals
fee = 10






The core stepping commands are short:





  • continue (c) — run to the next breakpoint.


  • next (n) — step over the current line.


  • step (s) — step into a function call.


  • stepout (so) — run until the current function returns.


  • print x (p x) — evaluate an expression.



One thing fmt.Println cannot do: change state while stopped.

Delve can. set writes to a variable in the live program:




(dlv) set fee = 5
(dlv) print fee
5






That alone pays for learning the tool. You can test a fix

hypothesis without editing, rebuilding, and rerunning.





Conditional breakpoints



The worker pool spawns fifty goroutines. The bug is on order 37.

If you continue through a plain breakpoint, you stop fifty times

and read fifty frames looking for the one that matters. That is

worse than the print loop.



A conditional breakpoint fires only when an expression is true.

Set the breakpoint, then attach a condition to it:




(dlv) break process
Breakpoint 1 set at 0x... for main.process() ./main.go:14
(dlv) condition 1 o.ID == 37
(dlv) continue






Delve runs past every order except 37, then stops. Confirm you

landed where you wanted:




(dlv) print o.ID
37
(dlv) next
(dlv) next
(dlv) next
(dlv) print fee
-10






There it is. fee went negative on order 37. You found the exact

input that triggers the bug without reading a single frame you did

not care about.



You can set the condition in one line with break:




(dlv) break main.go:16 o.ID == 37






Delve also has hit-count conditions through the condition -hitcount

form, so you can break on the 100th call to a hot function:




(dlv) condition -hitcount 1 > 99









Inspecting goroutines



This is where Delve leaves every other approach behind. When the

program is stopped, goroutines lists every live goroutine:




(dlv) goroutines
* Goroutine 1 - User: ./main.go:36 main.main
Goroutine 6 - User: ./main.go:33 main.main.func1
Goroutine 7 - User: ./main.go:33 main.main.func1
...






The * marks the goroutine you are currently on. Switch to

another one by its ID and its stack becomes your context:




(dlv) goroutine 7
Switched from 1 to 7
(dlv) stack
0 0x... in main.process
at ./main.go:16
1 0x... in main.main.func1
at ./main.go:33






From there, frame moves up and down the stack, and print

reads locals in whichever frame you selected:




(dlv) frame 1
(dlv) print ord
main.Order {ID: 37, Total: 100}






For a leak hunt, the count matters. If you expect the pool to

drain and it does not, goroutines shows the ones still parked and

stack tells you exactly which line they are blocked on. A parked

channel receive, a sync.WaitGroup that never reaches zero, a

mutex nobody released: the stack names the line. No amount of

printing gets you that view of the whole runtime at once.





Attaching to a running process



The scenarios above assume you launched the program under Delve.

Production does not work that way. The process is already up, it is

misbehaving, and restarting it under a debugger would clear the

state you need to see.



Delve attaches to a running process by PID. Find it, then attach:




// find the pid
pgrep myservice

// attach (may need sudo, or ptrace_scope tuning on Linux)
dlv attach 48213






When you attach, Delve pauses the process. Every goroutine

freezes where it is. Now the same commands work: goroutines to

see what is running, stack to see where a stuck one is blocked,

print to read live state. When you continue, the process

resumes; when you detach (or answer no to the kill prompt on

quit), the process keeps running.



Two operational notes. On Linux, the kernel's

ptrace_scope setting often blocks attaching to a process you did

not start; you either run dlv as root or lower the scope. And

attaching pauses the process, so on a live service you are trading a

short stall for a look inside. Know that before you attach to

something taking traffic.



There is also a headless mode for remote debugging. Start Delve as

a server on the machine where the process lives:




dlv attach 48213 --headless --listen=:2345 --api-version=2






Then connect from your laptop with dlv connect host:2345 or point

your editor's debug client at that port. That is how you debug a

process inside a container: run the headless server next to it, map

the port out, connect from where your source lives.






Where fmt.Println still wins



Delve is not a total replacement. A print statement that logs on

every request, running in production for a week, catches the

intermittent bug that never shows up while you are watching. A

debugger cannot sit and wait for a Tuesday-only race. Structured

logging and tracing own that job.



The split is about time. Reach for the debugger when you can

reproduce the problem now and want to see the state directly. Reach

for logs when the problem is rare, slow, or only happens in an

environment you cannot attach to. Most Go developers over-index on

prints because they never learned the other half. Now you have.



Start small: next time you would add a fmt.Println, run

dlv debug instead, set one breakpoint, and print the variable.

The muscle memory comes fast, and you stop shipping debug lines you

forgot to delete.






Delve understands goroutines because it understands the runtime,

and the runtime is exactly where most Go debugging goes wrong. The

Complete Guide to Go Programming
digs into the scheduler,

goroutine states, and the calling conventions Delve reads, so the

goroutines and stack output stops being a mystery. Hexagonal

Architecture in Go
is the companion for keeping your code in shape

where you rarely need the debugger in the first place — clean

boundaries mean fewer places for state to go sideways.



Thinking in Go — the 2-book series on Go programming and hexagonal architecture

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
3 Knoten · 2 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
25 Quellen
CVE-2026-135550 | Mozilla Firefox Web Codecs memory corruption (Nessus ID 388625)
VulDB Updates vor 1 Std.
24 weitere Quellen
VulDB Updatesvor 1 Std.CVE-2026-135551 | Mozilla Firefox up to 153.7/160 Layout use after free (Nessus ID 388625) VulDB Updatesvor 1 Std.CVE-2026-135552 | Mozilla Firefox up to 115.45/153.7/160 Canvas2D use after free (Nessus ID 388625) VulDB Updatesvor 1 Std.CVE-2026-135554 | Mozilla Firefox up to 115.45/153.7/160 Navigation use after free (Nessus ID 388625) VulDB Updatesvor 1 Std.CVE-2026-135556 | Mozilla Firefox up to 115.45/153.7/160 JIT memory corruption (Nessus ID 388625) VulDB Updatesvor 3 Std.CVE-2026-135540 | Mozilla Firefox up to 115.45/153.7/160 JIT memory corruption (Nessus ID 388625) VulDB Updatesvor 3 Std.CVE-2026-135539 | Mozilla Firefox up to 115.45/153.7/160 CSS Object Model use after free (Nessus ID 388625) VulDB Updatesvor 3 Std.CVE-2026-135542 | Mozilla Firefox up to 115.45/153.7/160 Layout buffer overflow (Nessus ID 388625) VulDB Updatesvor 3 Std.CVE-2026-135541 | Mozilla Firefox up to 115.45/153.7/160 XSLT use after free (Nessus ID 388625) VulDB Updatesvor 3 Std.CVE-2026-135544 | Mozilla Firefox up to 115.45/153.7/160 Navigation memory corruption (Nessus ID 388625) VulDB Updatesvor 3 Std.CVE-2026-135545 | Mozilla Firefox up to 153.7/160 Editor memory corruption (Nessus ID 388625) VulDB Updatesvor 3 Std.CVE-2026-135543 | Mozilla Firefox up to 115.45/153.7/160 Networking memory corruption (Nessus ID 388625) VulDB Updatesvor 3 Std.CVE-2026-135547 | Mozilla Firefox up to 115.45/153.7/160 Networking sandbox (Nessus ID 388625) VulDB Updatesvor 3 Std.CVE-2026-135549 | Mozilla Firefox up to 115.45/153.7/160 XSLT use after free (Nessus ID 388625) VulDB Updatesvor 3 Std.CVE-2026-135548 | Mozilla Firefox up to 115.45/153.7/160 Layout use after free (Nessus ID 388625) VulDB Updatesvor 4 Std.CVE-2026-135533 | Mozilla Firefox up to 115.45/153.7/160 Layout Tables off-by-one (Nessus ID 388625) VulDB Updatesvor 4 Std.CVE-2026-135536 | Mozilla Firefox up to 115.45/153.7/160 DOM Editor uninitialized pointer (Nessus ID 388625) VulDB Updatesvor 4 Std.CVE-2026-135535 | Mozilla Firefox up to 115.45/153.7/160 Skia input validation (Nessus ID 388625) VulDB Updatesvor 4 Std.CVE-2026-135537 | Mozilla Firefox up to 115.45/153.7/160 Layout Text/Fonts out-of-bounds (Nessus ID 388625) VulDB Updatesvor 5 Std.CVE-2026-135525 | Mozilla Firefox up to 115.45/153.7/160 WebRender use after free (Nessus ID 388625) VulDB Updatesvor 5 Std.CVE-2026-135526 | Mozilla Firefox up to 115.45/153.7/160 Networking use after free (Nessus ID 388625) VulDB Updatesvor 5 Std.CVE-2026-135527 | Mozilla Firefox up to 115.45/153.7/160 DOM/HTML use after free (Nessus ID 388625) VulDB Updatesvor 5 Std.CVE-2026-135528 | Mozilla Firefox up to 153.7/160 HTTP race condition (Nessus ID 388625) VulDB Updatesvor 5 Std.CVE-2026-135530 | Mozilla Firefox up to 115.45/153.7/160 HTTP sandbox (Nessus ID 388625) VulDB Updatesvor 5 Std.CVE-2026-135529 | Mozilla Firefox up to 153.7/160 Text sandbox (Nessus ID 388625)
17 Quellen
Apple Cyber Monday Deals (2026): AirPods, iPads, MacBooks, and More
WIRED vor 17 Min.
16 weitere Quellen
The Mac Observervor 25 Min.Aqara W200 thermostat is $119.99 for Cyber Monday, $40 off and Apple Home ready Latest from TechRadarvor 44 Min.Cyber Monday mini PC deals 2026 live — top tiny desktops from GMKtec, Geekom, Minisforum, and more as the Black Friday sale continues The Mac Observervor 50 Min.Sonos Beam Gen 2 is $339 for Cyber Monday, $160 off and $359 under two HomePods The Mac Observervor 1 Std.Magic Mouse in black drops to $79.99 for Cyber Monday, $19 under Apple’s $99 The Mac Observervor 1 Std.Garmin fenix 8 47mm drops $250 to $749.99 for Cyber Monday, $49 under Ultra 4 Latest from TechRadarvor 2 Std.I've been waiting for a better deal on the Philips LatteGo 4400 — and Amazon has delivered a record-low price for Cyber Monday Latest from TechRadarvor 2 Std.Looking to get a last-minute gaming gift before Cyber Monday is over? WIREDvor 3 Std.Last Call for Black Friday iPad Deals (2026): Save Up to $100 Latest from Windows Centralvor 3 Std.Why I bought a handheld over a gaming laptop on Cyber Monday Latest from TechRadarvor 3 Std.I found the most capable PC under $300 for Cyber Monday — Origimagic's C7 Windows 11 Pro machine packs dual Thunderbolt 4, 2.5Gb LAN, a Core 3 100U, 16GB of RAM, and a 512GB SSD OS X Dailyvor 3 Std.Cyber Monday Deals: $300 Off 16″ PROLED MacBook Pro, $100 Off AirPods Pro 3, $100 Off iPad Air, & More Latest from TechRadarvor 4 Std.Cyber Monday home office deals 2026 live — our top workspace picks from FlexiSpot, Dell, Anker, Logitech and more as Black Friday sale rolls on Latest from TechRadarvor 4 Std.The best Cyber Monday deals in the UK in 2026: top picks from Amazon, Argos, Ninja, Lego and more Latest from TechRadarvor 4 Std.Black Friday laptop deals 2026: the huge savings on MacBooks, Chromebooks and Windows 11 laptops still available from Apple, Dell, HP and many more Latest from TechRadarvor 4 Std.Cyber Monday Australia laptop deals for 2026: score up to 52% off Lenovo, Apple, Dell, HP and more Latest from TechRadarvor 4 Std.Amazon Australia Cyber Monday deals
12 Quellen
CVE-2026-116159 | ImageMagick up to 6.9.13-57/7.1.2-32 CDL Option memory leak (Nessus ID 388637)
VulDB Updates vor 1 Std.
11 weitere Quellen
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Debugging Go With Delve: Beyond fmt.Println

Thematisch verwandte Begriffe: Debugging, With, Delve, Beyond · 6 Treffer

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