Zum Hauptinhalt springen
LIVE
CVSS 6.9CVE-2026-137684 | A security flaw has been discovered in eosphoros-ai DB-GPT up to 0.8.3. This affects the function editor_sql_run of the file packages/dbgpt-app/src/dbgpt_app/openapi/api_v1/editor/api_editor_v1.py of the component Editor SQL Run API. Performing a manipulation of the argument db_name results in authorization bypass. It is possible to initiate the attack remotely. The exploit has been released to the public and may be used for attacks. The pull request to fixCVSS 8.7CVE-2026-137992 | libexpat through 2.11.0 contains a denial of service vulnerability in defineAttribute() of lib/xmlparse.c that fails to detect duplicate non-ID #IMPLIED or #REQUIRED attribute declarations. Attackers can supply a crafted XML document with repeated ATTLIST declarations in an internal DTD subset to cause quadratic CPU consumption in storeAtts() during parsing.CVSS 8.5CVE-2026-137994 | Leo through 6.8.10 contains an insecure deserialization vulnerability that allows attackers to execute code by embedding pickled data in unknown XML attributes of .leo outlines. Attackers can place a pickle __reduce__ gadget in a or element attribute that resolveUa passes to pickle.loads, executing code with user privileges when the outline is opened.CVSS 7.0CVE-2026-137995 | FOG Project before 1.6.0.119 contains an information disclosure vulnerability that allows unauthenticated attackers to obtain host tokens from status/hostgetkey.php by supplying a host MAC address. Attackers can present the token to service/hostinfo.php to retrieve decrypted Active Directory join credentials and Windows product keys during deployment windows.CVSS 6.8CVE-2026-137996 | Zettlr before 4.11.0 fails to validate URI schemes in Markdown link targets, allowing attackers to launch arbitrary registered protocol handlers via Electron shell.openExternal without confirmation. Attackers can craft documents whose Ctrl/Cmd-clicked links use smb:// to leak NTLM credential hashes on Windows or invoke custom protocol handlers with attacker-controlled parameters.CVSS 8.5CVE-2026-137997 | HCIPy through 0.7.1 contains an insecure deserialization vulnerability that allows attackers to execute code by supplying crafted .pkl files to read_field, read_grid or read_mode_basis. Because hcipy/util/io.py selects pickle by file extension and calls pickle.load, a __reduce__ gadget in a pupil, apodizer, PSF or mode-basis file runs code with the user's privileges.CVSS 8.5CVE-2026-137998 | Detoxify 0.5.3 through 0.5.4 contains an insecure deserialization vulnerability in load_checkpoint that allows attackers to execute code by supplying a crafted checkpoint file. Attackers can embed a pickle __reduce__ gadget in a .ckpt file loaded via torch.load with weights_only=False to run code with the user's privileges.CVSS 8.5CVE-2026-137999 | JSONSchema2PoPo2 through 3.0.3 contains a code injection vulnerability that allows attackers to inject Python code by supplying JSON Schema default or format values that are written unescaped. Attackers can place a single quote in a string property default to break out of the literal in the generated __init__ signature, executing injected code when the generated module is imported.
Alle im Drawer
Intelligence View
⚡ tsecurity.de Intelligence

From Source Code to Binary: What Does GCC Actually Do?

When we write a C program, we work with high-level concepts like functions, variables, and loops. However, your computer's processor only understands raw…

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

When we write a C program, we work with high-level concepts like functions, variables, and loops. However, your computer's processor only understands raw binary instructions. The compiler, gcc (GNU Compiler Collection), acts as a universal translator, transforming your human-readable code into machine-executable logic.



To illustrate this, we use a simple program:




#include <stdio.h>

int main() {
printf("Hello world\n") ;
printf("multiple parameters %s %i %i\n","test",1,2) ;
}









1. The Invisible Compilation Journey



gcc is not just a single tool; it is an orchestrator that runs several sequential stages:



The Preprocessor: It handles directives like #include . It replaces this line with the entire content of the header file, preparing the code for compilation.



Compilation: The C code is transformed into assembly language, which is a textual representation of machine instructions.



Assembly: The assembler translates these instructions into binary format (object files .o).



Linking: This is the crucial final step. Your code uses printf, a function belonging to the standard C library (libc). The linker connects your code to the actual addresses of these functions within the system library.






2. Anatomy of a Binary: From Source to Execution



After the linking process, gcc generates an ELF File which contains several sections and several compiler-generated functions






A. Binary Sections: The Anatomy of the ELF File





  • .init & .fini: These sections contain code executed before and after your main function. They handle global setup and teardown.

  • .plt (Procedure Linkage Table): This section acts as a "trampoline" for external library functions (like printf). Since the exact memory address of libc is determined at runtime, the .plt enables dynamic linking.


  • .text: This is where your actual code—the main function and compiler-generated support functions—resides. It is marked as Read-Only and Executable to prevent tampering.







B. Compiler-Generated Functions



gcc adds several functions to your binary that you never explicitly wrote. These are essential for the program's lifecycle:





  • _start: This is the real entry point of your program. It is called by the OS kernel. It initializes the environment (arguments, environment variables) and then calls __libc_start_main.


  • __libc_start_main: A standard library function that prepares the environment for your main function and calls it


  • register_tm_clones / deregister_tm_clones: These functions handle Transactional Memory management. They are part of the GCC runtime overhead.


  • __do_global_dtors_aux: This function is responsible for calling destructors for global objects before the program exits.


  • frame_dummy: A helper function used to register frame information for exception handling.






C. Execution Flow: What Happens When You Run ./hello?



When you launch the program from your shell, the following sequence occurs:



a. OS Kernel Loading: The Linux kernel maps the binary into memory and hands control to the dynamic linker (ld-linux.so).

b. _start: The kernel jumps to _start. It cleans up the stack, sets up the initial registers, and invokes the C library's initialization logic.

c. Initialization (.init): The code in the .init section runs, setting up the runtime environment.

d. main Invocation: __libc_start_main calls your main function.

e. printf Execution: Inside main, your code calls printf. It jumps to the .plt entry, which resolves the library address and executes the actual print command.

f. Termination: After main returns, the program invokes __do_global_dtors_aux (to clean up globals) and the .fini section, then exits by calling a kernel system call.





Summary Table





































Stage Function/Section Responsibility
Setup _start Prepare registers and invoke libc
Init .init Global initializations
Logic main Your custom code
Linkage .plt Resolving library functions (printf)
Cleanup .fini Final program shutdown




3. The Mechanics of Parameter Passing (System V AMD64 ABI Convention)



In the C programming language, passing arguments between functions does not rely on a "magic" stack, but on a strict convention called the System V AMD64 ABI. To optimize for speed, the gcc compiler prioritizes using CPU registers before resorting to memory (the stack).



When a function is called, the parameters are placed in the following specific registers, in this exact order:



rdi: 1st argument

rsi: 2nd argument

rdx: 3rd argument

rcx: 4th argument

r8: 5th argument

r9: 6th argument



If your function requires more than 6 arguments, the additional parameters are then pushed onto the stack, which is significantly slower.



See below for some examples of the System V AMD64 ABI mechanism



In the objdump analysis of the main function, you could observe this sequence:




0000000000401156 <main>:
401156: f3 0f 1e fa endbr64
40115a: 55 push %rbp
40115b: 48 89 e5 mov %rsp,%rbp
40115e: 48 8d 05 9f 0e 00 00 lea 0xe9f(%rip),%rax # 402004 <_IO_stdin_used+0x4>
401165: 48 89 c7 mov %rax,%rdi
401168: e8 e3 fe ff ff call 401050 <puts@plt>
40116d: b9 02 00 00 00 mov $0x2,%ecx
401172: ba 01 00 00 00 mov $0x1,%edx
401177: 48 8d 05 92 0e 00 00 lea 0xe92(%rip),%rax # 402010 <_IO_stdin_used+0x10>
40117e: 48 89 c6 mov %rax,%rsi
401181: 48 8d 05 8d 0e 00 00 lea 0xe8d(%rip),%rax # 402015 <_IO_stdin_used+0x15>
401188: 48 89 c7 mov %rax,%rdi
40118b: b8 00 00 00 00 mov $0x0,%eax
401190: e8 cb fe ff ff call 401060 <printf@plt>
401195: b8 00 00 00 00 mov $0x0,%eax
40119a: 5d pop %rbp
40119b: c3 ret






One of the most interesting aspects revealed by disassembly is GCC's optimization logic. For the simple string 'Hello world\n', the compiler identifies that no formatting is required and replaces the call to the more complex printf with a call to the more efficient puts function. This demonstrates that GCC is not just a translator, but an optimizer that actively refines your code for better performance.



For the first instruction the compiler fills the register rdi.



When calling the second printf, we can observe the compiler strictly adhering to the System V ABI. It populates the registers in the following order:



rdi: Holds the address of the format string.

rsi: Holds the address of the string argument 'test'.

rdx: Holds the first integer (1).

rcx: Holds the second integer (2).



By analyzing the assembly, we see exactly how the compiler maps your C variables to the CPU's 'highways'."






4. Epilogue



In this very short article we explained what gcc does when it compiles a C source code.

By disassembling your own code (with objdump), you precisely see what gcc creates during the compilation process. gcc adds control code (prologues/epilogues) and linking mechanisms (.plt, .got) that are essential for your program to communicate with the operating system. Moreover it follows a strict mechanism for passing arguments.

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:

💬 Dyskusja społeczności i komentarze

🌐 Dołącz do głównego czatu

Rozpocznij dyskusję w strumieniu transmisji Social Chat lub prześlij wyżej wkład ekspercki przez formularz uzupełnień.

Cyber Threat Intelligence i Kryminalistyka

Navigator ATT&CK · Radar IoC i Graf

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
⭐ Ocena czytelników
–
Ø / 5.0
Brak recenzji czytelników
Czy ten artykuł był pomocny?
0
Dodaj swoją ocenę
Ocena szczegółowa (opcjonalnie)
Treść i jakość
Źródło i wiarygodność
Aktualność
Security Briefing Bezpłatnie · Wypisanie 1 kliknięciem

Intelligence Digest - bezpłatnie

Codziennie najważniejsze wiadomości bezpieczeństwa · można pobrać w każdej chwili

Powiązany klaster opowieści i źródła (wektor AI)

2 Cluster
2 źródeł
OpenAI counter-sues Apple over trade secret theft
AppleInsider News 3 godziny temu
1 inne źródło
Podobne wkłady
🔍 Verwandte News

Auch interessante Nachrichten From Source Code to Binary: What Does GCC Actually Do?

Thematisch verwandte Begriffe: From, Source, Code, Binary · 6 Treffer

Laden...

Składki są załadowane...

Laden...

Filmy są załadowane...

Laden...

Składki są załadowane...

Laden...

Filmy są załadowane...

Laden...

Składki są załadowane...

Laden...

Filmy są załadowane...

Laden...

Składki są załadowane...

Laden...

Filmy są załadowane...

Uwagi Komentarze są ładowane..
Rysunek do aktualizacji
Widgets & Topics
Loading widgets…
Nächster Beitrag