2023-05-08: Thoughts on overlarge fields in formats and protocols

A few days ago I had a fun chat with Ange Albertini about secure design of file formats – a topic Ange has been passionately researching for some time now. One of the specific problems that we discussed were overlarge fields and how to approach them in a file format or communication protocol design in a way that makes certain that their handling is safe and secure by default. In this blogpost I wanted to discuss two of my ideas (neither of which is perfect) and related observations on this topic.

What is an overlarge field?

It's best to explain this using one of my favorite examples – same one I've used in my "How to find vulnerabilities?" blog post and in several talks.

In the GIF image format specification there is a field called LZW code size which holds the initial LZW compression code size in bits.

         7 6 5 4 3 2 1 0
        +---------------+
        | LZW code size |
        +---------------+

What exactly the value entails isn't really important for this discussion. What is however important is that said value must be between 3 and 12 (inclusive).

The second important piece of information is that the field holding this value is a typical byte (8-bit) field.

This of course means that while on paper the value should be between 3 and 12, technically the actual field in a GIF file can contain any value in the range of 0 to 255. I.e. the field is too large for the actual value it's supposed to hold and thus I call it an overlarge field1.
1 Do note that this isn't an official term, just something I'm going to use for the sake of this blog post.

The problem with overlarge fields

Read more... [ 4 comments ]

2023-04-05: Mega Sekurak Hacking Party – Maj 2023 (wystąpienie o CTFach)

22 maja będę miał "bezslajdowe" wystąpienie na kolejnym MSHP. Ponieważ będzie to dla mnie akurat sezon urlopowy, to i wystąpienie będzie trochę bardziej na luzie. Czyli będzie o CTFach!

Gynvael Coldwind – „Jak wygrywać CTFy: Tips & Tricks!”
"Whatever gets you the flag" - ta często powtarzana przeze mnie fraza ma na celu przekazanie dość prostej oczywistości: CTFy nie polegają na prawidłowym i zgodnym ze sztuką rozwiązywaniu zadań, a na zdobyciu flag. Czasem można trochę „oszukać”, użyć jakiejś sztuczki, albo odpowiedniego narzędzia, co pozwala zdobyć flagę w krótszym czasie i pominąć sporą część zadania. Podczas tej prezentacji na żywo pokażę i omówię garść trików podłapanych i wypracowanych podczas 20 lat udziałów w konkursach hakerskich.

Na samym MSHP Sekurak, który organizuje wydarzenia, szykuje cztery ścieżki tematyczne (websec, netsec, defence oraz intro dla początkujących) oraz zapewnia cały dzień merytorycznych treści bez męczącego marketingu. Będą za to doskonali prelegenci, konkursów oraz inne niespodzianki. Dodatkowo każdy uczestnik dostanie dostęp do ponad 50 nagrań z czterech ostatnich edycji MSHP.

Do końca kwietnia z kodem: mshp-gyn35 bilety STANDARD macie 35% taniej.
Bilety można zamówić tutaj: https://sklep.securitum.pl/mega-sekurak-hacking-party-22-maja-2023 (jest tam trochę więcej informacji).

Do zobaczenia na MSHP!

Czytaj dalej... [ 1 komentarz ]

Five newest or recently updated notes (these are unfinished posts, code snippets, links or commands I find useful but always forget, and other notes that just don't fit on the blog):

Click here for a list of all notes.

EN Security papers and research notes

Some conference slides are linked at the bottom of this page.

EN Selected vulnerabilities

The full list of vulnerabilities discovered by me (including collaborative work) can be found here (please note that the list might be out of date).

The Google Application Security / Research site might also contain some of my findings.

EN Coding (selected posts)
EN Tools and libraries
  • PiXieServ is a simplified PXE (network boot) server for Windows and Linux-based OS, created for testing of very small home-made OS. See also the post about it.
  • ExcpHook, a system-wide exception monitor for Windows XP 32-bit. Useful if you're fuzzing something that doesn't like having a debugger attached.
  • Ent is an entropy measuring tool for reverse engineering reconnaissance (see also a post explaining how to use it).
  • HiperDrop is a simple command line process memory dumper for Windows, with a few different work modes.
  • asmloader - this little app executes headerless machine code (compiled assembly code). It's meant to be an aid in learning/teaching and playing with assembly, as well as the right tool when you just need to execute some machine code.
  • NetSock is a simple socket/networking lib/wrapper for C++ I've wrote back in 2003 and update from time to time - I use it for most of my network-enabled projects.
PL Videotutoriale i podcasty [ 0 views | 0 videos | 0 subscribers ]

Subscribe to me on YouTube W wolnym czasie prowadzę videocasty na żywo o programowaniu, reverse engineeringu oraz hackingu/security:

Livestream | Kanał na YT | Archiwum starszych odcinków

Najnowszy odcinek: Gynvael's Livestream #75: Implementujemy serwer FTP
[ 0 thumbs up | 0 comments | 0 views ]

Dodatkowo: ReverseCraft - starsza seria podcastów o reverse engineeringu i assembly.

PL Edukacyjnie (wybrane posty)

Dla programistów:

Security / hacking:

  • Hacking - jak uczyć się security/hackingu i spać spokojnie.

Dodatkowo, kilka przemyśleń na temat odnajdywania się na rynku pracy w IT:

PL Programowanie (wybrane posty)

← trochę więcej postów jest po angielskojęzycznej stronie.

PL Gamedev i GFX (wybrane posty)

Grafika generowana proceduralnie:

【 design & art by Xa / Gynvael Coldwind 】 【 logo font (birdman regular) by utopiafonts / Dale Harris 】