Articles I've written

Origin, site, eTLD, eTLD+1, public suffix, PSL. What are they?
November 20, 2023

We call it pages, domains, servers, websites, internets and we hope the other party will understand. Maybe, maybe not, but that can always be cleared with the additional “wait, a server, don't you mean a website?” You can't just ask those questions when reading various specifications and technical documents, so they try to call things by their correct names and in a consistent manner. And they do it so well that terms like origin, site, same origin, same site, eTLD and public suffix are normally not even translated to other languages, because then nobody would understand it. And how does the attractiveness of subdomains relate to this?

(read more…)

Overriding HTTP response content in Chrome
October 5, 2023

The Chrome browser (and others like Edge) allows you to override both HTTP response headers and the response content. I've previously written about overriding the headers for testing purposes, let's see how you can override the body, or the content itself, as well. Starting with Chrome 117 (released in September 2023) it's also greatly simplified.

(read more…)

Validity period of HTTPS certificates issued from a user-added CA is essentially 2 years
August 18, 2023

Since 2020, maximum lifetime of HTTPS certificates is limited to 1 year, exactly 398 days. I've previously written about the history and the reasons behind the change. But the reduced lifetime applies only to certificates issued from a public certification authority (CA) added to the operating system's or the browser's trusted root store by the vendor.

(read more…)

Overriding HTTP response headers in Chrome
May 4, 2023 (updated October 5, 2023)

Starting with Chrome 113 (and in other browsers like Edge), you can override HTTP response headers, or add a new one. This is handy as you can override e.g. some security headers for testing. The HTTP response header override will be applied before things like CSP are processed so you can modify the Content Security Policy for the page for example.

(read more…)

Check vulnerable packages with composer audit
January 25, 2023

When a security vulnerability is discovered in one of the PHP libraries you use, there are several options how you can learn about the bug before it's too late. I've written about PHP Security Advisories Database in one of my previous posts and how you can use it with Roave Security Advisories and a few other ways. However all of them require an extra package or a tool.

(read more…)

Inspecting HTTPS traffic in iOS, on Windows with Fiddler
December 1, 2020 (updated February 9, 2024)

Some time ago, I've change my Google password. That change logged me out of my Google account on my iPad so Photos, Chrome, and other apps were asking again for my password to log me back in. The only problem was that all I could see, was a blank page instead of the Google login form, or just -- (NSURLErrorDomain: -999) error.

(read more…)

Don't let security bugs catch you off guard
November 9, 2020 (updated September 19, 2023)

At the end of August, a critical security bug was discovered and immediately fixed in one of the popular PHP frameworks, Nette. Although the author of the framework, David Grudl, did everything possible, some did not learn about the bug in time and did not update their sites and web apps. Let me tell you a few tips not only for PHP, that will help you to know about similar problems as soon as possible.

(read more…)

My web security training, now available remotely
June 9, 2020

I'm organizing another round of my training, this time remotely. Afternoons, for half of the regular price.

(read more…)

Check TLS certificate revocation with SSL Labs, crt.sh and OpenSSL

Browsers mostly don't check whether a HTTPS certificate has been revoked so maybe you'd like to do it manually. There are a few ways how to query an Online Certificate Status Protocol (OCSP) server so let's see some of them. You'll need a browser (and the openssl tool).

(read more…)

Maximum HTTPS certificate lifetime to be 1 year soon
February 21, 2020 (updated September 2, 2020)

In February 2020 at the CA/Browser Forum in Bratislava, Slovakia (and later officially), Apple has announced that starting September 1st, 2020, maximum TLS certificate lifetime in Safari (and probably in the whole macOS and iOS and all apps) will be just 1 year, 398 days exactly. Apple's change has been followed by both Chrome and Mozilla later that year. That's very good news. But why?

(read more…)

I don't use any VPN for security or anonymity
October 23, 2019

NordVPN, a VPN service provider, got hacked some time in 2018. In their official response, they say that only one server was affected due to an insecure remote management system left on the machine by the datacenter provider. Private keys got leaked (bad), some other VPN providers were also breached (bad) but that's not what I want to write about (good) because there are better places to read about it.

(read more…)

Top 10 coffee brands according to Have I Been Pwned

Top 10 coffee brands based on how much their names are used as passwords. Look, not every password research has to be meaningful.

(read more…)

Android-based 2FA security key
April 11, 2019 (updated January 15, 2020)

Yesterday, Google announced yet another Security Key to be used for two-factor authentication (2FA, sometimes 2-step verification, 2SV) for Google's services. This one is built directly into Android 7+ so you may already have it in your pocket. It uses Bluetooth (but pairing isn't required) and currently works only in Chrome and Chromium-based browsers – Google says it's a beta version. And that's basically all we know about it. I use 2FA where possible, I recommend using it whenever possible so I just had to try it.

(read more…)

Slovak websites in the “Collection #1” password database and friends
January 23, 2019

Yesterday I checked Czech websites in “Collection #1” and others (like “Collection #2” to “Collection #5”, “BigDB”), today I've checked Slovak sites. We're neighboring countries and historically have a lot in common, many Czech users have accounts on Slovak sites as well, so it seemed like a good idea.

(read more…)

Czech websites in the “Collection #1” password database and friends
January 22, 2019

Last week was all about the 773 million records data breach, nicknamed “Collection #1”. It's a few years old compilation of previous data leaks but it's still interesting to check which Czech websites (and Slovak, too) are present in this and other databases (like “Collection #2” to “Collection #5”, “BigDB”).

(read more…)

Using JavaScript to modify URLs and hide fbclid
November 7, 2018

Roughly two weeks ago, Facebook started adding a tracking parameter, fbclid (Facebook click id?), to all external links users share. And I didn't like it so I'm hiding it.

(read more…)

Disable TLS 1.0 & 1.1 today
October 16, 2018 (updated March 23, 2021)

Microsoft, Google, Apple & Mozilla announced yesterday that they're removing TLS 1.0 and TLS 1.1 protocols from Internet Explorer, Edge, Chrome, Safari & Firefox browsers in the beginning middle of 2020. Your visitors most probably don't use them already so you can disable them in your server configs today. But let's verify that first using the “Handshake Simulation” tool available in the SSL Labs Server Test.

(read more…)

Browsers are hiding the padlock and it's a Good Thing™
October 15, 2018 (updated October 21, 2023)

Magical properties are often attributed to the padlock icon 🔒 which marks “secure” pages. For example, you'll often hear that the icon indicates trustworthy websites that won't abuse your data and passwords. The padlock is gradually being removed and that's a Good Thing™. But why?

(read more…)

Account takeover in regional transportation system Lítačka

Just a few weeks ago, a new regional transportation system called Lítačka (a slang word for prepaid municipal transportation ticket used in some parts of the Czech Republic) was put into operation in Prague and the Central Bohemian Region. The system allows passengers to buy tickets in a mobile application, passengers can also pair their tickets with their payment cards so the validity of the prepaid ticket can later be checked by waving the card near random card readers in transportation vehicles. You could also steal a password reset link right from the unsuspecting user's browser.

(read more…)

Not secure: Chrome and HTTP websites
July 25, 2018 (updated September 13, 2023)

Chrome started marking all HTTP websites as Not secure yesterday (on my birthday, what a gift!) with their release of Chrome 68. The treatment is not a red warning yet, just a gray (i). And there's a lot of busy czech websites getting that treatment. And how did we get here anyway and what's next?

(read more…)

Adding features & deleting code, or How I joined Report URI
June 30, 2018

I joined Report URI, the real-time security reporting tool, a year ago. In fact, my first code change was June 27, 2017. Since then I've added 709,402 more lines. And deleted 1,981,599 lines.

(read more…)

What's security.txt and why you should have one
April 9, 2018 (updated July 28, 2023)

Add security.txt to your site, with correct contact details inside the file, so that people reporting security issues won't have to guess where to send the reports to. Using a real example, I'll show you why having such file is a good idea.

(read more…)

A password manager as an employee benefit
March 30, 2018 (updated August 26, 2019)

“The developer was using the same email and password combination on GitHub.” What can go wrong? Hell of a lot can go wrong.

(read more…)

Cracking passwords from the Mall.cz dump
January 2, 2018

You don't crack passwords using rainbow tables or brute-force attacks anymore. So this probably wasn't a plaintext leak, somebody have cracked 750k passwords and uploaded them online. I've tried cracking them too.

(read more…)

This is how you respond to a disclosure
December 22, 2017

I've reported Stored XSS vulnerability and it was triaged, fixed, tested and deployed in less than an hour. On Friday. Before Christmas.

(read more…)

Last dates for Intro to PHP, Classes & objects in PHP training
October 10, 2017 (updated March 1, 2018)

The time has come and after 6 years I'm closing my public training Introduction to PHP and Classes and objects in PHP, the last round this December. I'm also writing some new courses.

(read more…)

Upgrading existing password hashes
September 5, 2017 (updated August 2, 2019)

Still using MD5 or SHA-1 to store user passwords and want to gracefully migrate to e.g. bcrypt? Want to do it properly to protect all passwords in the database? Here's how.

(read more…)

Chrome, ERR_SPDY_PROTOCOL_ERROR, and an invalid HTTP header
August 28, 2017 (updated January 25, 2023)

When migrating your site to a more performant HTTP/2 protocol, it may happen that Chrome will not load a page and will display This site can’t be reached with ERR_SPDY_PROTOCOL_ERROR instead. HTTP/2 is derived from the earlier SPDY protocol, that's probably why the error message doesn't mention HTTP/2 at all. I'll show you how to figure it out with chrome://net-export.

(read more…)

Post a boarding pass on Facebook, get your account stolen
August 16, 2017 (updated October 16, 2017)
Do you need a TLS/SSL certificate for your website?
August 10, 2017
UR browser: “VPN” and other tales
April 25, 2017 (updated June 1, 2020)

UR is a fast and secure web browser. With a built-in VPN, ad blocker, virus scanner and more, UR helps you protect your privacy online.

Except it doesn't. The “VPN” is just a proxy and the connection between the browser and the proxy server is not even encrypted.

(read more…)

Czech LinkedIn profiles with purged or typo emails
April 3, 2017

I could hijack 629 LinkedIn accounts by re-registering purged inactive (or mistyped) email addresses at the largest free email provider in the Czech Republic, Seznam.cz. But I haven't, of course.

(read more…)

“Jak ukládáme hesla vám z důvodu bezpečnosti neprozradíme”
October 14, 2016
Když na otázku “jak ukládáte hesla?” dostanete neurčitou odpověď nebo když vám to někdo nechce prozradit, spíš očekávejte, že vaše hesla nejsou v bezpečí.

(read more…)

Opera představila VPN, která vlastně není VPN. Takhle funguje
April 25, 2016
Opera Software ve své tiskové zprávě tvrdí, že jejich “VPN” je lepší, než tradiční VPN. No, jak se to vezme.

(read more…)

Opera browser's VPN is just a proxy
April 22, 2016

Behind the curtain, the VPN in the Opera browser is just a proxy. Here's how it works.

(read more…)

Jak se stahovala Sobotkova pošta? Využíval se software Hacking Teamu?
January 15, 2016
Dělat screenshoty umí malware, který se označuje jako RAT (Remote Access Trojan), ten umí také třeba zaznamenávat stisknuté klávesy atd. Nemusí to být zrovna „špičkový software“, takových programů je určitě spousta a dělat screenshoty patří do jejich základní výbavy. Ostatně, dělat screenshoty umí i sám browser pomocí JavaScriptu.

(read more…)

Viděl jsem Specifikaci projektu Elektronická evidence tržeb
December 21, 2015
“Viděl jsem věci, kterým byste vy, lidé, nevěřili”, tak začíná monolog Roye Battyho ve filmu Blade Runner a já mám po přečtení Specifikace projektu Elektronická evidence tržeb velmi podobný pocit.

(read more…)

Seznam s HTTPS zaspal, weboví špioni si mnou ruce
October 26, 2015
Viděli jste špionážní film nebo seriál odehrávající se v posledních letech nebo blízké budoucnosti? Mizera prohlíží něco na počítači, zatímco agenti mu do počítače nahrají program, který jim ho pak pomůže vystopovat. Podobné scény se dostaly už i do South Parku. Schválně nemluvím o sci-fi filmech, protože podobné triky již do této kategorie dávno nepatří.

(read more…)

Seznam a weby na HTTPS – dobrá i špatná zpráva
October 7, 2015
Kterou chcete slyšet první? To je jedno, já vám stejně povím nejdřív tu dobrou. Seznam vyřešil jeden z problémů s horším umístěním webů na HTTPS ve výsledcích vyhledávání. Přesun na HTTPS ale doporučuje odložit na příští rok.

(read more…)

Co se stalo LastPass a jak vytvářet silná a zapamatovatel­ná hesla
June 25, 2015
O bezpečnostním problému oblíbeného správce hesel LastPass jste už asi zaslechli a možná si o něm i něco přečetli. Po incidentu vyšla spousta článků s informacemi pro uživatele, a poněvadž se o hesla tak trochu zajímám, tak jsem jich pár přečetl, a dokonce jsem se začetl i do komentářů, což obvykle nedělám.

Pokusím se shrnout, co o problému víme, a zabrousím i trochu do technických detailů fungování LastPassu, a tím se pokusím aspoň trochu vyvrátit některé fámy a mýty. Na závěr uvedu pár dobrých rad, jak LastPass více zabezpečit.

(read more…)

Mobilní aplikace Seznam – zabezpečení neznám
February 25, 2015
Že Seznam kromě přebarvených nebo jinak vylepšených verzí Opery, Firefoxu a Internet Exploreru nabízí svůj vlastní prohlížeč, to jste už asi zaslechli. Že v době vydání na tom byl se zabezpečením dost mizerně, to jste se možná už taky dočetli.

A víte, že Seznam má i vlastní mobilní prohlížeče, jak pro Android, tak pro iOS? Přestaňte jásat a zadržte. Než si je do svých chytrých telefonů a jiných pádel nainstalujete, přečtěte si, co jsem o jednom z nich zjistil. Pojďme se tedy podívat, co je na webovém prohlížeči také důležitého a co může nepříjemně ovlivnit vaše soukromí. V závěru se lehce podíváme i na mobilní aplikaci Email.cz.

(read more…)

Informace důvěrné jako rozhovor
February 3, 2015
Před pár dny jsem vyprávěl kamarádovi o zabezpečení přenosu informací po internetu. Chtěl popsat, co všechno bych mohl se špatně zabezpečeným tokem dat dělat, kdybych byl mizera. Kamarád sice provozuje internetový obchod, ale nerozumí všem těm technickým výrazům a zkratkám, a tak chtěl, abych mu na nějakém příkladu popsal, proč je to vlastně důležité a k čemu se nezabezpečená data mohou někomu hodit, zkrátka abych to k něčemu přirovnal. A já jsem si vzpomněl na jeden takový příběh, na kterém bych problematiku šifrování přenosu dat rád přiblížil i vám.

(read more…)

Nejčastější bezpečnostní chyby na českých webech, vysvětleny „pro lidi“
January 20, 2015
V závěrečném shrnutí hodnocení soutěže WebTop100 2013 jsem popisoval, jak takové hodnocení vypadá (to je ten článek, kde jsme se naučili, kolik nul má kvintiliarda), kolik si u toho porotce užije legrace a kam všude mu zablokují přístup.

No, víte, ono to zas taková sranda není, takže o co bude dnešní článek méně zábavný, o to bude stejně (málo) technický. Tak nějak lidsky v něm popíšu pár nejčastějších problémů zabezpečení webů, abyste si pod těmi nulami v hodnocení dokázali představit, jak malé nebo velké problémy se na webech dají nalézt. Skočte si zalít to instantní kafe a pojďme na to.

(read more…)

Zdálo se mi o WebExpo 2014
August 28, 2014
Holky a kluci, co dělají tento rok WebExpo požádali garanty a vůbec všechny, aby se podělili o svůj průchod WebExpem. Už se podělil Riki FridrichJirka Sekera, u mě byla touha podělit se dokonce tak silná, že se mi dneska v noci zdálo o tom, jak bude WebExpem prolítávat Špaček. Musím si to zapsat, abych ho náhodou nezapomněl a pak si 14. září večer neříkal “jakou přednášku jsem to vlastně chtěl vidět?” Ten sen vypadal tedy nějak takhle…

(read more…)

The Reason I Built “We Bleed” and How I Did It
May 16, 2014
It’s already been a month since we first heard about the Heartbleed Bug. In this article I’d like to share the results of a small weekend research project I’ve been working on.

(read more…)

Jak jsem ukradl sezení administrátorovi a objednal ruskou vodku za kvintiliardu
November 7, 2013
Zabezpečení mnoha tuzemských e-shopů je tragické. Všechny mnou hodnocené online obchody v letošním ročníku soutěže WebTop100 získaly za oblast bezpečnosti nula bodů.

(read more…)

Shrnutí souteže WebTop100 2012
August 30, 2013
Měl jsem tu možnost a štěstí hodnotit weby i v minulém ročníku soutěže WebTop100, takže toto moje shrnutí bude do jisté míry srovnáním s výsledky mého bádání v roce 2011. Můj názor je totiž ten, že důležitější, než současný stav věcí, je směr, kterým se ubírají. V tak dynamickém prostředí, které nazýváme Internet, to platí dvojnásob.

(read more…)

CZ Podcast 75 Errata
April 2, 2013
Před pár dny jsem konečně zjistil, kolik lidí slyšelo CZ Podcast o bezpečnosti webových aplikací, ve kterém jsem byl hostem. To číslo samozřejmě znám úplně přesně a dokonce všechny tři posluchače znám i jménem. Byl jsem to totiž já, Ondřej Mirtes a Jakub Vrána. Poslední tři jmenovaní mě zároveň upozornili na několik faktických chyb a nepřesností. Důvody, proč k těm chybám a nepřesnostem došlo nejsou podstatné, ale omlouvám se za ně. Rád bych tedy v tomto článku tyto tiskové chyby opravil.

(read more…)

Skype, Joltid a core technology
March 27, 2013
V posledních dnech se hodně mluví a píše o Yahoo a koupi Summly. A taky o tom, že Summly nevlastní svoji “core technology”, ale že si ji pronajímá. Nevím, co tou akvizicí Yahoo sleduje a celkem je mi to jedno, ale tato situace tu není poprvé. Před pár lety se stalo něco podobného v mnohem větší míře, za víc peněz s větším rizikem.

(read more…)

Neautorizovaný přístup k datům
January 23, 2013
V posledních dnech, týdnech a měsících jsem několikrát slyšel a četl o tom, že velkým hráčům unikla nějaká data, případně se někdo dostal k informacím, které vidět neměl, a to naprosto jednoduchým způsobem. „Útočník“ pouze změnil nějaké číslo v adrese stránky a v prohlížeči se mu najednou ukázaly údaje, k jejichž prohlížení nebyl autorizován. Jak je to jen možné?

(read more…)

České weby jsou uživatelsky příjemná bezpečnostní katastrofa
October 15, 2012
Napsat dobře web není žádná legrace. Je třeba k tomu mnoho umět, dát si pozor na mnohá úskalí a překonat řadu překážek a chyb. Naučili se už konečně čeští programátoři dělat web pořádně? Na to odpoví jeden z porotců soutěže WebTop100, kterému rukama prošly dvě stovky webů. Radost vám udělá jen napůl.

(read more…)

Today is your lucky day
September 10, 2012
O tom, že když se budete trochu snažit a trochu makat, tak dosáhnete toho, co chcete. O tom, že občas musíte být ve správnou dobu na správném místě. A taky o tom, že se vyplatí otevřít pusu nejen proto, abyste do ní nalili pivo.

(read more…)

Bezpečnost je míra, ne vlastnost
May 28, 2012
Chtěl bych se s vámi podělit o jeden příběh, který se nedávno odehrál. A poněvadž nebyl vyroben kdesi v Hollywoodu, ale napsal ho sám vývojářův život, tak není moc veselý. Na jeho konci se totiž místo závěrečných titulků rolujících po plátně za zvuku dojemných melodií objeví přístupové údaje k databázi jedné české a mnou oblíbené (a někdy od roku 2015 již nefunkční) webové služby na sdílení obrázků Twio.cz.

(read more…)

WebExpo 2012 Call for Papers
May 21, 2012
Necelou minutu před deadline jsem odeslal přihlášku svých dvou příspěvků na WebExpo 2012. Potvrzující e-mail, který přišel zpět má čas 23:59:53 a samotného by mě zajímalo, kolik lidí přihlášku odeslalo po mě. Díky patří organizátorům WebExpa i Jeanne Trojan, za to, že mě zcela nezištně dokopali k tomu, abych aspoň jedno téma přihlásil.

(read more…)

FPD aneb Full Path Disclosure
April 29, 2012
FPD je jedna z přibližně 17576 třípísmenných zkratek používaných na Internetu a jedna z mála, kde písmeno F neznamená, hmm, třeba friend. Význam zkratky, o kterém bych vám rád povyprávěl je však důležitý pro bezpečnost webových aplikací. FPD totiž v oblasti webové bezpečnosti znamená Full Path Disclosure, do češtiny přeloženo například jako odhalení, nebo raději lépe prozrazení úplné cesty.

(read more…)

Mass Assignment v PHP
March 27, 2012
Počátkem března se Rails komunitou prohnal hurikán jménem @homakov. Škod naštěstí nenapáchal mnoho, jenom se lehce otřel o GitHub a odnesl střechu a plot. Mohl si vzít cokoliv, ale asi by to neunesl (a to asi ani psychicky).

(read more…)

PHP 4 a PHP 5 zároveň na jednom fyzickém serveru s Windows XP
November 20, 2005
Důvod, proč provozovat PHP 4 a zároveň PHP 5 je vskutku jednoduchý, prostě to tak chceme. Ať už kvůli tomu, že budeme ohýbat staré (čti dříve napsané) aplikace (čti skripty) a zároveň psát nové a ty staré prostě nechceme, nebo nemůžeme upravovat na nové verzi PHP a ty nové, ač můžeme, tak na staré verzi PHP psát nechceme.

(read more…)