{"title":"defnull","link":[{"@attributes":{"href":"https:\/\/defnull.de\/","rel":"alternate"}},{"@attributes":{"href":"https:\/\/defnull.de\/feeds\/all.atom.xml","rel":"self"}}],"id":"https:\/\/defnull.de\/","updated":"2026-07-24T00:00:00+02:00","entry":[{"title":"Bakers' Club","link":{"@attributes":{"href":"https:\/\/defnull.de\/2026\/bakers-club\/","rel":"alternate"}},"published":"2026-07-24T00:00:00+02:00","updated":"2026-07-24T00:00:00+02:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2026-07-24:\/2026\/bakers-club\/","summary":"<blockquote>\n<p>A short story about baking and community. Totally not about AI or the current situation in FOSS.<\/p>\n<\/blockquote>\n<p>In a small town, there was a bakers' club popular with professionals and hobbyists alike. Every Saturday, they would gather at the local cafe and bring their homemade cakes and pies; they ate \u2026<\/p>","content":"<blockquote>\n<p>A short story about baking and community. Totally not about AI or the current situation in FOSS.<\/p>\n<\/blockquote>\n<p>In a small town, there was a bakers' club popular with professionals and hobbyists alike. Every Saturday, they would gather at the local cafe and bring their homemade cakes and pies; they ate, drank coffee, talked, and exchanged the latest recipes. It was nice.<\/p>\n<p>One day, a new visitor arrived from out of town. He didn't say a word, didn't bring any cake, but tasted every cake there was and picked out the best pieces to take home with him. The regulars were confused, but shrugged it off and moved on with their lives.<\/p>\n<p>The following week, he came back, drank all the coffee, took every single cake, and left again. People tried to talk to him, but he would not listen. This was unacceptable, so the group decided not to open the door for him next time.<\/p>\n<p>A week later, he visited again, but the door was locked. He banged on the door, demanded access to the cakes, even cracked the glass a little, and screamed that cake was free, so he had a right to take it. But the shocked people in the cafe did not open the door, so he left. The bakers talked and wondered what a single person would do with so many cakes. They had no idea.<\/p>\n<p>The next week, almost two dozen new visitors arrived. All from different towns, all at the same time. The parking lot was so full that many regulars could not find a spot. But the new visitors looked normal, behaved normally, even brought some store-bought donuts, so they were let in. The event was open for visitors after all. But something was off. They didn't speak much, didn't share any of their own recipes, and no one knew them. At the end of the evening, each of them took just enough cake not to look suspicious. In the end, all the cakes were gone, and the regulars looked at their empty plates in confusion. Cake is meant to be eaten, but this was wrong.<\/p>\n<p>The Bakers' Club held an extraordinary meeting. They had to do something, so they decided to only accept visitors from now on if they bring their own homemade cake. Also, everyone was allowed to take home only one slice. The news spread quickly. People who regularly enjoyed the pleasant atmosphere but couldn't bake themselves felt they were being treated unfairly. After all, they hadn't done anything wrong! They just wanted to enjoy some cake.<\/p>\n<p>The Saturday after the meeting, it was even more crowded than the week before. There was not a single parking spot left in the entire street. The new people were locals and even brought cakes this time, but they looked strangely familiar and odd at the same time. Some cakes were a mixture of many different recipes and tasted too sweet or too dry. Others were burned, some had collapsed, one cake was made with salt instead of sugar, and another was beautifully decorated, but its core was made out of cardboard. The regular members looked at the cakes and tasted them, but they were all awful. The new people who brought them still looked proud, praised the new cooking app they all seemed to use, and didn't accept any advice. \"The new app knows more than you,\" they said. \"We don't need to be bakers to bake a cake! The app tells us what to do,\" they said. They couldn't even understand what was wrong with their cakes.<\/p>\n<p>Most of the regulars didn't come back the next week. Too much noise, too many people who couldn't really bake and didn't want to learn. The parking situation was horrible, and every bite was a gamble. Most cakes were awful; some were dangerous. The recipes were unoriginal, flawed, useless. Nothing special, nothing new. People once came to the bakers' club to get new ideas and inspiration, talk to peers, and learn from each other to become better bakers. But that was no longer possible. Too many people relied on the new app. They couldn't kick them all out. It was a lost cause.<\/p>\n<p>So here we are.<\/p>\n<p>Months later, the cafe is still busy every Saturday. The app has improved a lot, especially after that one week when several people were hospitalized with food poisoning after eating cake. The cakes are mostly edible now, and some are genuinely beautiful, but they still do not taste very good. People proudly show off their creations, talk about decoration and style or the new app version, but rarely taste them or take slices home for later. Most cakes go to the trash after the event. No one talks about recipes anymore. But they seem to have fun.<\/p>\n<p>Some of the old bakers have started a new club and rented a small private kitchen. Members only, but you can bring friends. No one is required to show up with a finished cake anymore. Instead, they bring ingredients, ideas, and questions. They bake together, only one or two cakes an evening. They learn, share experiences, talk about the time when an app took over their old club, and enjoy some cake. It may not be the best or most beautiful cake ever. Sometimes they have to order pizza, but even then they learn something. And next Saturday, they'll meet again.<\/p>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"writing"}},{"@attributes":{"term":"foss"}}]},{"title":"Python multipart\/form-data Parser Benchmark","link":{"@attributes":{"href":"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/","rel":"alternate"}},"published":"2026-07-09T00:00:00+02:00","updated":"2026-07-18T00:00:00+02:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2026-07-09:\/2026\/python-multipart-benchmark\/","summary":"<p>This benchmark covers the most commonly used Python parsers for <code>multipart\/form-data<\/code> (HTML5 forms) and tests them in different scenarios, comparing both blocking and non-blocking (async) APIs if\navailable. Source code is available here: <a href=\"https:\/\/github.com\/defnull\/multipart_bench\/\">https:\/\/github.com\/defnull\/multipart_bench\/<\/a><\/p>\n<p>The <a href=\"https:\/\/multipart.readthedocs.io\/en\/latest\/\">multipart<\/a> library is used as a baseline, because it is \u2026<\/p>","content":"<p>This benchmark covers the most commonly used Python parsers for <code>multipart\/form-data<\/code> (HTML5 forms) and tests them in different scenarios, comparing both blocking and non-blocking (async) APIs if\navailable. Source code is available here: <a href=\"https:\/\/github.com\/defnull\/multipart_bench\/\">https:\/\/github.com\/defnull\/multipart_bench\/<\/a><\/p>\n<p>The <a href=\"https:\/\/multipart.readthedocs.io\/en\/latest\/\">multipart<\/a> library is used as a baseline, because it is currently the fastest pure-python parser tested and also the reason I'm benchmarking parsers in the first place.<\/p>\n<h2 id=\"contestants\">Contestants<a class=\"headerlink\" href=\"#contestants\" title=\"Permanent link\">&para;<\/a><\/h2>\n<ul>\n<li><a href=\"https:\/\/pypi.org\/project\/multipart\/\">multipart<\/a> v2.0.0<ul>\n<li>Used in <a href=\"https:\/\/pypi.org\/project\/bottle\/\">Bottle<\/a>, <a href=\"https:\/\/litestar.dev\/\">LiteStar<\/a>, <a href=\"https:\/\/zope.readthedocs.io\/\">Zope<\/a> and others.<\/li>\n<li><a href=\"https:\/\/docs.python.org\/3.12\/library\/cgi.html\">CPython docs<\/a> recommend it as a <code>cgi.FieldStorage<\/code> replacement.<\/li>\n<li>Disclaimer: I am the author and maintainer of this library.<\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/pypi.org\/project\/Werkzeug\/\">werkzeug<\/a> v3.1.8<ul>\n<li>Used in <a href=\"https:\/\/pypi.org\/project\/Flask\/\">Flask<\/a> and others.<\/li>\n<li>Does a lot more than <em>just<\/em> multipart parsing.<\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/pypi.org\/project\/Django\/\">django<\/a> v6.0.7<ul>\n<li>Full featured web framework, not just a parser.<\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/pypi.org\/project\/python-multipart\/\">python-multipart<\/a> v0.0.32<ul>\n<li>Used in <a href=\"https:\/\/pypi.org\/project\/starlette\/\">Starlette<\/a> and thus <a href=\"https:\/\/pypi.org\/project\/fastapi\/\">FastAPI<\/a>.<\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/pypi.org\/project\/streaming-form-data\/\">streaming-form-data<\/a> v2.1.0<ul>\n<li>Partly written in Cython.<\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/pypi.org\/project\/emmett-core\/\">emmett-core<\/a> v1.4.1<ul>\n<li>Mostly written in Rust.<\/li>\n<li>Similar to Django or werkzeug, this library does a lot more than <em>just<\/em> multipart parsing. It is not a stand-alone parser, but a support library for the <a href=\"https:\/\/emmett.sh\/\">emmett<\/a> framework and rarely used outside of this context.<\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/docs.python.org\/3.12\/library\/cgi.html\">cgi.FieldStorage<\/a> CPython 3.12.3<ul>\n<li>Deprecated in Python 3.11 and removed in Python 3.13<\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/docs.python.org\/3.12\/library\/email.parser.html#email.parser.BytesFeedParser\">email.parser.BytesFeedParser<\/a> CPython 3.12.3<ul>\n<li>Designed as a parser for emails, not <code>multipart\/form-data<\/code>.<\/li>\n<li>Buffers everything in memory, including large file uploads.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Not included:<\/strong> Some parsers <em>cheat<\/em> by loading the entire request body into memory\n(e.g. sanic or litestar before they switched to multipart). Those are obviously\nvery fast in benchmarks but also very unpractical when dealing with large file\nuploads.<\/p>\n<h2 id=\"updates\">Updates<a class=\"headerlink\" href=\"#updates\" title=\"Permanent link\">&para;<\/a><\/h2>\n<ul>\n<li><strong>30.09.2024<\/strong> <code>python-multipart<\/code> v0.0.11 fixed a bug that caused extreme\n  slowdowns (as low as 0.75MB\/s) in all three worst-case scenarios.<\/li>\n<li><strong>30.09.2024<\/strong> There was an issue with the <code>email<\/code> parser that caused it to\n  skip over the actual parsing and also not do any IO in the blocking test.\n  Throughput was way higher than expected. This is fixed now.<\/li>\n<li><strong>30.09.2024<\/strong> Default size for in-memory buffers is different for each parser,\n  resulting in an unfair comparison. The tests now configure a limit of 500K for\n  each parser, which is the hard-coded value in <code>werkzeug<\/code> and also a sensible\n  default.<\/li>\n<li><strong>03.10.2024<\/strong> New version of <code>multipart<\/code> with slightly better results in some tests.<\/li>\n<li><strong>05.10.2024<\/strong> Added results for <code>streaming-form-data<\/code> parser.<\/li>\n<li><strong>25.10.2024<\/strong> Added results for <code>django<\/code> parser.<\/li>\n<li><strong>06.11.2024<\/strong> Added results for <code>emmett-core<\/code> parser.<\/li>\n<li><strong>24.12.2024<\/strong> New versions for many libraries and an additional \"worstcase_junk\"\n  scenario. The results were so bad for some of the libraries that I reported it\n  as a potential security issue (DoS vulnerability) to the most affected libraries\n  and waited for a fix to be available before publishing results.<\/li>\n<li><strong>09.07.2026<\/strong> A lot has happened and new versions were released. I updated the\n  benchmark runner to report mean throughput instead of the 'best' result of all runs,\n  and let it run for as long as necessary to achieve stable results. This should reduce\n  the impact of noise and give more realistic results. I also render some plots now.\n  Enjoy :)<\/li>\n<\/ul>\n<h2 id=\"method\">Method<a class=\"headerlink\" href=\"#method\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>All tests were performed on a pretty old \"AMD Ryzen 5 3600\" running Linux 6.17.0\nand Python 3.12.3 with highest possible priority and pinned to a single core.<\/p>\n<p>For each test, the parser is created with default\u00b9 settings and the results are\nthrown away. Some parsers buffer to disk, but <code>TEMP<\/code> points to a ram-disk to\nreduce disk IO from the equation. Each test is repeated until the relative\nconfidence interval around the trimmed\u00b2 average runtime is narrow enough, then\nthe scenario input size is divided by that runtime to get a nice MB\/s throughput\nestimate per core.<\/p>\n<p>The fastest pure-python parser (currently <code>multipart<\/code>) is used as the 100% baseline\nfor each test. This ensures that pure python parsers are always easy to compare\nagainst each other, and parsers written in compiled languages can be included without\nscrewing with the results too much.<\/p>\n<p>\u00b9) There is one exception: The limit for in-memory buffered files is set to\n500KB (hard-coded in <code>werkzeug<\/code>) to ensure a fair comparison.\n\u00b2) We ignore the top and bottom 10% of all measurements per test to remove extreme\noutliers, but still keep realistic outliers that may actually happen during\nreal-world operation due to allocation pressure or context switches.<\/p>\n<h2 id=\"results\">Results<a class=\"headerlink\" href=\"#results\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>Parser throughput is measured in MB\/s (input size \/ time). Higher throughput is\nbetter.<\/p>\n<h3 id=\"scenario-simple\">Scenario: simple<a class=\"headerlink\" href=\"#scenario-simple\" title=\"Permanent link\">&para;<\/a><\/h3>\n<p><strong>Description<\/strong>: A simple form with just two small text fields.<\/p>\n<p>This scenario is so small that it shows initialization and interpreter overhead\nmore than actual parsing performance, which benefits <code>emmett-core<\/code> the most\nbecause everything happens in Rust and outside of the python runtime. The results\nfor <code>streaming-form-data<\/code> are a bit surprising though, given that it is partly\nwritten in Cython and compiled to native code. My guess is that there is some\nsignificant overhead when calling Python callbacks from Cython, which happens a\nlot in this test. When comparing the pure-python parsers, <code>multipart<\/code> is the\nclear winner.<\/p>\n<p><strong>Note:<\/strong> Small forms like these should better be transmitted as\n<code>application\/x-www-form-urlencoded<\/code>, which has a lot less overhead compared to\n<code>multipart\/form-data<\/code> and should be a lot faster to parse, so take this benchmark\nwith a large grain of salt. This is an uncommon and artificial scenario.<\/p>\n<p><img alt=\"Non-blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/simple-non-blocking.svg\"><\/p>\n<p><img alt=\"Blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/simple-blocking.svg\"><\/p>\n<table>\n<thead>\n<tr>\n<th>Parser<\/th>\n<th>Non-Blocking (MB\/s)<\/th>\n<th>Blocking (MB\/s)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>multipart<\/td>\n<td>20.96 MB\/s (100%)<\/td>\n<td>10.70 MB\/s (100%)<\/td>\n<\/tr>\n<tr>\n<td>python-multipart<\/td>\n<td>5.50 MB\/s (26%)<\/td>\n<td>3.24 MB\/s (30%)<\/td>\n<\/tr>\n<tr>\n<td>werkzeug<\/td>\n<td>4.01 MB\/s (19%)<\/td>\n<td>3.06 MB\/s (29%)<\/td>\n<\/tr>\n<tr>\n<td>django<\/td>\n<td>-<\/td>\n<td>1.74 MB\/s (16%)<\/td>\n<\/tr>\n<tr>\n<td>streaming-form-data<\/td>\n<td>0.45 MB\/s (2%)<\/td>\n<td>0.43 MB\/s (4%)<\/td>\n<\/tr>\n<tr>\n<td>cgi<\/td>\n<td>-<\/td>\n<td>2.60 MB\/s (24%)<\/td>\n<\/tr>\n<tr>\n<td>email<\/td>\n<td>2.41 MB\/s (11%)<\/td>\n<td>2.19 MB\/s (20%)<\/td>\n<\/tr>\n<tr>\n<td>emmett-core<\/td>\n<td>-<\/td>\n<td>54.27 MB\/s (507%)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"scenario-large\">Scenario: large<a class=\"headerlink\" href=\"#scenario-large\" title=\"Permanent link\">&para;<\/a><\/h3>\n<p><strong>Description<\/strong>: A large form with 100 small text fields.<\/p>\n<p>This scenario benefits parsers with low per-field overhead or a line-based\nparser design (like <code>cgi<\/code> and <code>email<\/code>) because each field is just a single line,\nand there are a lot of them. Initialization overhead is less important here\ncompared to the 'simple' scenario above.<\/p>\n<p>No surprise that <code>emmett-core<\/code> performs well here, because the payload still\nfits in a small number of chunks and other than <code>streaming-form-data<\/code> the parser\ndoes not have to call into Python code for each field. The Rust parser thus\ncompletely bypasses the python interpreter overhead. <code>email<\/code> also performs\nreasonably well, as it is designed for this type of line-based text input and\neven surpasses many of the other pure-python parsers, but <code>multipart<\/code> is still\nmore than three times as fast.<\/p>\n<p><img alt=\"Non-blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/large-non-blocking.svg\"><\/p>\n<p><img alt=\"Blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/large-blocking.svg\"><\/p>\n<table>\n<thead>\n<tr>\n<th>Parser<\/th>\n<th>Non-Blocking (MB\/s)<\/th>\n<th>Blocking (MB\/s)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>multipart<\/td>\n<td>33.03 MB\/s (100%)<\/td>\n<td>21.64 MB\/s (100%)<\/td>\n<\/tr>\n<tr>\n<td>python-multipart<\/td>\n<td>10.65 MB\/s (32%)<\/td>\n<td>5.57 MB\/s (26%)<\/td>\n<\/tr>\n<tr>\n<td>werkzeug<\/td>\n<td>6.89 MB\/s (21%)<\/td>\n<td>5.25 MB\/s (24%)<\/td>\n<\/tr>\n<tr>\n<td>django<\/td>\n<td>-<\/td>\n<td>3.18 MB\/s (15%)<\/td>\n<\/tr>\n<tr>\n<td>streaming-form-data<\/td>\n<td>0.62 MB\/s (2%)<\/td>\n<td>0.60 MB\/s (3%)<\/td>\n<\/tr>\n<tr>\n<td>cgi<\/td>\n<td>-<\/td>\n<td>3.47 MB\/s (16%)<\/td>\n<\/tr>\n<tr>\n<td>email<\/td>\n<td>7.21 MB\/s (22%)<\/td>\n<td>6.12 MB\/s (28%)<\/td>\n<\/tr>\n<tr>\n<td>emmett-core<\/td>\n<td>-<\/td>\n<td>80.12 MB\/s (370%)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"scenario-upload\">Scenario: upload<a class=\"headerlink\" href=\"#scenario-upload\" title=\"Permanent link\">&para;<\/a><\/h3>\n<p><strong>Description<\/strong>: A file upload with a single large (32MB) file.<\/p>\n<p>Now it gets interesting! When dealing with actual file uploads, both\n<code>python-multipart<\/code> and <code>streaming-form-data<\/code> catch up and are now faster than\n<code>werkzeug<\/code> or <code>django<\/code>. All four are slower than <code>multipart<\/code>, but the results\nare still impressive. The line-based <code>cgi<\/code> and <code>email<\/code> parsers on the other hand\nstruggle a lot, probably because there are some line-breaks in the test file\ninput. This flaw shows even more in some of the tests below.<\/p>\n<p>What really surprised me here was the poor performance of <code>emmett-core<\/code>. It\nshould be the fastest parser in all scenarios (because \"Rust\") but in the first\ntest that actually moves some bytes, it falls back significantly. My best guess\nis that the context translation overhead between Python and the native Rust code\nis to blame. The parser is fed chunks of bytes and each round involves call-overhead\nand expensive copy operations. Pure python code can work directly with the\nprovided byte string and avoid some of that overhead. But that's just a guess.<\/p>\n<p><img alt=\"Non-blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/upload-non-blocking.svg\"><\/p>\n<p><img alt=\"Blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/upload-blocking.svg\"><\/p>\n<table>\n<thead>\n<tr>\n<th>Parser<\/th>\n<th>Non-Blocking (MB\/s)<\/th>\n<th>Blocking (MB\/s)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>multipart<\/td>\n<td>7917.98 MB\/s (100%)<\/td>\n<td>592.66 MB\/s (100%)<\/td>\n<\/tr>\n<tr>\n<td>python-multipart<\/td>\n<td>5898.54 MB\/s (74%)<\/td>\n<td>576.24 MB\/s (97%)<\/td>\n<\/tr>\n<tr>\n<td>werkzeug<\/td>\n<td>1781.72 MB\/s (23%)<\/td>\n<td>390.91 MB\/s (66%)<\/td>\n<\/tr>\n<tr>\n<td>django<\/td>\n<td>-<\/td>\n<td>413.69 MB\/s (70%)<\/td>\n<\/tr>\n<tr>\n<td>streaming-form-data<\/td>\n<td>3739.50 MB\/s (47%)<\/td>\n<td>467.73 MB\/s (79%)<\/td>\n<\/tr>\n<tr>\n<td>cgi<\/td>\n<td>-<\/td>\n<td>90.56 MB\/s (15%)<\/td>\n<\/tr>\n<tr>\n<td>email<\/td>\n<td>61.00 MB\/s (1%)<\/td>\n<td>51.84 MB\/s (9%)<\/td>\n<\/tr>\n<tr>\n<td>emmett-core<\/td>\n<td>-<\/td>\n<td>209.11 MB\/s (35%)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"scenario-mixed\">Scenario: mixed<a class=\"headerlink\" href=\"#scenario-mixed\" title=\"Permanent link\">&para;<\/a><\/h3>\n<p><strong>Description<\/strong>: A form with two text fields and two small file uploads (1MB and 2MB).<\/p>\n<p>This is the most realistic test and shows similar results to the upload scenario.\n<code>streaming-form-data<\/code> falls back a bit and is now closer to <code>werkzeug<\/code> and\n<code>django<\/code>. <code>emmett-core<\/code> is unexpectedly slow again, slower than most modern\npure-python parsers, but still way faster than the line-based <code>cgi<\/code> and <code>email<\/code>\nparsers. <code>multipart<\/code> outperforms all of them by a significant margin.<\/p>\n<p><img alt=\"Non-blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/mixed-non-blocking.svg\"><\/p>\n<p><img alt=\"Blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/mixed-blocking.svg\"><\/p>\n<table>\n<thead>\n<tr>\n<th>Parser<\/th>\n<th>Non-Blocking (MB\/s)<\/th>\n<th>Blocking (MB\/s)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>multipart<\/td>\n<td>7060.78 MB\/s (100%)<\/td>\n<td>569.70 MB\/s (100%)<\/td>\n<\/tr>\n<tr>\n<td>python-multipart<\/td>\n<td>4937.82 MB\/s (70%)<\/td>\n<td>477.80 MB\/s (84%)<\/td>\n<\/tr>\n<tr>\n<td>werkzeug<\/td>\n<td>1612.26 MB\/s (23%)<\/td>\n<td>363.60 MB\/s (64%)<\/td>\n<\/tr>\n<tr>\n<td>django<\/td>\n<td>-<\/td>\n<td>367.26 MB\/s (64%)<\/td>\n<\/tr>\n<tr>\n<td>streaming-form-data<\/td>\n<td>1446.79 MB\/s (20%)<\/td>\n<td>366.13 MB\/s (64%)<\/td>\n<\/tr>\n<tr>\n<td>cgi<\/td>\n<td>-<\/td>\n<td>59.80 MB\/s (10%)<\/td>\n<\/tr>\n<tr>\n<td>email<\/td>\n<td>45.11 MB\/s (1%)<\/td>\n<td>41.31 MB\/s (7%)<\/td>\n<\/tr>\n<tr>\n<td>emmett-core<\/td>\n<td>-<\/td>\n<td>162.78 MB\/s (29%)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"scenario-worstcase_crlf\">Scenario: worstcase_crlf<a class=\"headerlink\" href=\"#scenario-worstcase_crlf\" title=\"Permanent link\">&para;<\/a><\/h3>\n<p><strong>Description<\/strong>: A 1MB upload that contains nothing but windows line-breaks.<\/p>\n<p>This is the first scenario that should not happen under normal circumstances\nbut is still an important test if you want to prevent malicious uploads from\nslowing down your web service. <code>multipart<\/code>, <code>python-multipart<\/code>, <code>werkzeug<\/code> and\n<code>django<\/code> are mostly unaffected and produce consistent results. <code>emmett-core<\/code> is\nstill slower than the modern pure-python parsers, but not specifically because of\nthis input. <code>streaming-form-data<\/code> is now several magnitudes slower than it should be,\nbut still faster than the line-based parsers. Those choke on the high number of\nline-breaks and are practically unusable.<\/p>\n<p><img alt=\"Non-blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/worstcase_crlf-non-blocking.svg\"><\/p>\n<p><img alt=\"Blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/worstcase_crlf-blocking.svg\"><\/p>\n<table>\n<thead>\n<tr>\n<th>Parser<\/th>\n<th>Non-Blocking (MB\/s)<\/th>\n<th>Blocking (MB\/s)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>multipart<\/td>\n<td>4764.80 MB\/s (100%)<\/td>\n<td>538.72 MB\/s (100%)<\/td>\n<\/tr>\n<tr>\n<td>python-multipart<\/td>\n<td>4212.23 MB\/s (88%)<\/td>\n<td>464.25 MB\/s (86%)<\/td>\n<\/tr>\n<tr>\n<td>werkzeug<\/td>\n<td>2404.59 MB\/s (50%)<\/td>\n<td>406.56 MB\/s (75%)<\/td>\n<\/tr>\n<tr>\n<td>django<\/td>\n<td>-<\/td>\n<td>384.60 MB\/s (71%)<\/td>\n<\/tr>\n<tr>\n<td>streaming-form-data<\/td>\n<td>31.58 MB\/s (1%)<\/td>\n<td>29.24 MB\/s (5%)<\/td>\n<\/tr>\n<tr>\n<td>cgi<\/td>\n<td>-<\/td>\n<td>3.11 MB\/s (1%)<\/td>\n<\/tr>\n<tr>\n<td>email<\/td>\n<td>3.56 MB\/s (0%)<\/td>\n<td>3.55 MB\/s (1%)<\/td>\n<\/tr>\n<tr>\n<td>emmett-core<\/td>\n<td>-<\/td>\n<td>161.30 MB\/s (30%)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"scenario-worstcase_lf\">Scenario: worstcase_lf<a class=\"headerlink\" href=\"#scenario-worstcase_lf\" title=\"Permanent link\">&para;<\/a><\/h3>\n<p><strong>Description<\/strong>: A 1MB upload that contains nothing but linux line-breaks.<\/p>\n<p>Linux line breaks are not valid in segment headers or boundaries, which benefits\nparsers that do not try to be nice and parse invalid input for compatibility\nreasons. <code>streaming-form-data<\/code> is less affected this time and performs well. The\ntwo line-based parsers on the other hand are even worse than before. Throughput is\nroughly halved, probably because there are twice as many line-breaks (and thus\nlines) in this scenario.<\/p>\n<p><img alt=\"Non-blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/worstcase_lf-non-blocking.svg\"><\/p>\n<p><img alt=\"Blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/worstcase_lf-blocking.svg\"><\/p>\n<table>\n<thead>\n<tr>\n<th>Parser<\/th>\n<th>Non-Blocking (MB\/s)<\/th>\n<th>Blocking (MB\/s)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>multipart<\/td>\n<td>7060.39 MB\/s (100%)<\/td>\n<td>576.96 MB\/s (100%)<\/td>\n<\/tr>\n<tr>\n<td>python-multipart<\/td>\n<td>4687.22 MB\/s (66%)<\/td>\n<td>498.97 MB\/s (86%)<\/td>\n<\/tr>\n<tr>\n<td>werkzeug<\/td>\n<td>2191.02 MB\/s (31%)<\/td>\n<td>407.42 MB\/s (71%)<\/td>\n<\/tr>\n<tr>\n<td>django<\/td>\n<td>-<\/td>\n<td>377.97 MB\/s (66%)<\/td>\n<\/tr>\n<tr>\n<td>streaming-form-data<\/td>\n<td>1334.40 MB\/s (19%)<\/td>\n<td>362.86 MB\/s (63%)<\/td>\n<\/tr>\n<tr>\n<td>cgi<\/td>\n<td>-<\/td>\n<td>1.50 MB\/s (0%)<\/td>\n<\/tr>\n<tr>\n<td>email<\/td>\n<td>2.22 MB\/s (0%)<\/td>\n<td>2.24 MB\/s (0%)<\/td>\n<\/tr>\n<tr>\n<td>emmett-core<\/td>\n<td>-<\/td>\n<td>163.69 MB\/s (28%)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"scenario-worstcase_bchar\">Scenario: worstcase_bchar<a class=\"headerlink\" href=\"#scenario-worstcase_bchar\" title=\"Permanent link\">&para;<\/a><\/h3>\n<p><strong>Description<\/strong>: A 1MB upload that contains parts of the boundary.<\/p>\n<p>This test was originally added to show an issue with <code>python-multipart<\/code>, but the biggest\nslowdowns were fixed quickly after reporting. It still struggles a bit and is on par\nwith <code>werkzeug<\/code> in this test, but both are acceptable. <code>multipart<\/code> also slows down a bit\ncompared to the non-malicious scenarios, but is still significantly fatser than the\nothers. <code>streaming-form-data<\/code> takes the biggest hit here, it is now even slower than the\nline-based legacy parsers.<\/p>\n<p><img alt=\"Non-blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/worstcase_bchar-non-blocking.svg\"><\/p>\n<p><img alt=\"Blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/worstcase_bchar-blocking.svg\"><\/p>\n<table>\n<thead>\n<tr>\n<th>Parser<\/th>\n<th>Non-Blocking (MB\/s)<\/th>\n<th>Blocking (MB\/s)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>multipart<\/td>\n<td>4760.55 MB\/s (100%)<\/td>\n<td>539.67 MB\/s (100%)<\/td>\n<\/tr>\n<tr>\n<td>python-multipart<\/td>\n<td>2190.70 MB\/s (46%)<\/td>\n<td>418.56 MB\/s (78%)<\/td>\n<\/tr>\n<tr>\n<td>werkzeug<\/td>\n<td>2020.43 MB\/s (42%)<\/td>\n<td>397.70 MB\/s (74%)<\/td>\n<\/tr>\n<tr>\n<td>django<\/td>\n<td>-<\/td>\n<td>363.08 MB\/s (67%)<\/td>\n<\/tr>\n<tr>\n<td>streaming-form-data<\/td>\n<td>31.77 MB\/s (1%)<\/td>\n<td>29.49 MB\/s (5%)<\/td>\n<\/tr>\n<tr>\n<td>cgi<\/td>\n<td>-<\/td>\n<td>35.10 MB\/s (7%)<\/td>\n<\/tr>\n<tr>\n<td>email<\/td>\n<td>37.13 MB\/s (1%)<\/td>\n<td>34.42 MB\/s (6%)<\/td>\n<\/tr>\n<tr>\n<td>emmett-core<\/td>\n<td>-<\/td>\n<td>150.56 MB\/s (28%)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"scenario-worstcase_junk\">Scenario: worstcase_junk<a class=\"headerlink\" href=\"#scenario-worstcase_junk\" title=\"Permanent link\">&para;<\/a><\/h3>\n<p><strong>Description<\/strong>: Junk before the first and after the last boundary (1MB each)<\/p>\n<p>The legacy multipart protocol allows arbitrary junk before the first and after\nthe last boundary, and requires parsers to ignore it. This protocol 'feature' has\nno practical use and no browser or HTTP client would ever do that, but parsers\nstill have to deal with it, one way or the other.<\/p>\n<p>When this was first discovered, <code>multipart<\/code> was the only implementation not\nshowing a drastic slowdown in this test. All the other parsers spent way too\nmuch time parsing and discarding junk. Some were so slow that I waited for\nthe most affected libraries to release fixes before I published any results, as\nthis may be abused for denial of service attacks, which can be a serious security\nissue. The results are still really bad for most of the parsers, but not as\ncatastrophic as it was before. Update your dependencies!<\/p>\n<p>Some of the parsers fail this test, but that's a good thing! Failing this test with a\nfast exception is <em>way<\/em> better than beeing slow. Malicious input can and should be\nrejected. <code>multipart<\/code> will also bail out very quickly in <em>strict<\/em> mode, but these tests\nare run in default mode which accepts some amounts of unusual input for compatibility\nreasons. It's still mostly unaffected, even in non-strict mode, as it manages to skip\njunk fast enough.<\/p>\n<p>You may have noticed that the blocking variants of most parsers are almost as fast as\nthe non-blocking versions in this scenario. This is because 'junk' does not emit any\nparser events and the blocking parts of the parser do not have to do much.<\/p>\n<p><img alt=\"Non-blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/worstcase_junk-non-blocking.svg\"><\/p>\n<p><img alt=\"Blocking parser throughput\" src=\"https:\/\/defnull.de\/2026\/python-multipart-benchmark\/plots\/worstcase_junk-blocking.svg\"><\/p>\n<table>\n<thead>\n<tr>\n<th>Parser<\/th>\n<th>Non-Blocking (MB\/s)<\/th>\n<th>Blocking (MB\/s)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>multipart<\/td>\n<td>5595.21 MB\/s (100%)<\/td>\n<td>5254.00 MB\/s (100%)<\/td>\n<\/tr>\n<tr>\n<td>python-multipart<\/td>\n<td><em>failed<\/em><\/td>\n<td><em>failed<\/em><\/td>\n<\/tr>\n<tr>\n<td>werkzeug<\/td>\n<td>39.10 MB\/s (1%)<\/td>\n<td>39.30 MB\/s (1%)<\/td>\n<\/tr>\n<tr>\n<td>django<\/td>\n<td>-<\/td>\n<td><em>failed<\/em><\/td>\n<\/tr>\n<tr>\n<td>streaming-form-data<\/td>\n<td><em>failed<\/em><\/td>\n<td><em>failed<\/em><\/td>\n<\/tr>\n<tr>\n<td>cgi<\/td>\n<td>-<\/td>\n<td>604.65 MB\/s (12%)<\/td>\n<\/tr>\n<tr>\n<td>email<\/td>\n<td>81.04 MB\/s (1%)<\/td>\n<td>80.72 MB\/s (2%)<\/td>\n<\/tr>\n<tr>\n<td>emmett-core<\/td>\n<td>-<\/td>\n<td><em>failed<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"conclusion\">Conclusion<a class=\"headerlink\" href=\"#conclusion\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>All modern pure-python parsers (<code>multipart<\/code>, <code>werkzeug<\/code>, <code>python-multipart<\/code>) are\nfast enough for most real-world use cases and behave correctly. All three offer\nnon-blocking APIs for asyncio\/ASGI environments with very little overhead and a\nhigh level of control. There are differences in API design, code quality,\nmaturity, support and documentation, but that's not the focus of this benchmark.\nThe <code>django<\/code> parser is also pretty solid, but hard to use outside of Django\napplications.<\/p>\n<p>For me, both <code>streaming-form-data<\/code> and <code>emmett-core<\/code> were a bit of a surprise.\nBoth are reasonably fast for large file uploads, but not as fast as you might\nexpect from parsers written in Cython or Rust. I would have never guessed that a\npure python parser can outperform both in the relevant tests. The overhead\nintroduced by those Python\/native compatibility layers seems to be significant.\nThe results for those two parsers were also very different. Lessons learned:\nAlways measure. Just because something is implemented in a faster language does\nnot mean it's actually faster.<\/p>\n<p>I probably do not need to talk much about <code>email<\/code> or <code>cgi<\/code>. Both show mixed\nperformance and are vulnerable to malicious inputs. <code>cgi<\/code> is deprecated (for\ngood reasons) and <code>email<\/code> is not designed for form data or large uploads at all.\nBoth are unsuitable or even dangerous to use in modern web applications.<\/p>\n<p>All in all, <code>multipart<\/code> seems to be a good choice for new projects. It's highly\noptimized with a strong focus on security, has 100% test coverage, no dependencies\nand does exactly what it is supposed to do, in the best possible way. But don't just\ntake my word for it, I'm obviously biased as the author of that library. Look at the\nresults, look at the test cases, check out the projects, try them out and make up\nyour own mind.<\/p>\n<p>Thanks for reading.<\/p>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"Python"}},{"@attributes":{"term":"infosec"}},{"@attributes":{"term":"multipart"}}]},{"title":"Fabricated conditions in AI security reports","link":{"@attributes":{"href":"https:\/\/defnull.de\/2026\/fabricated-AI-security\/","rel":"alternate"}},"published":"2026-05-24T00:00:00+02:00","updated":"2026-05-24T00:00:00+02:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2026-05-24:\/2026\/fabricated-AI-security\/","summary":"<p>Did you also notice a repeating pattern with AI security reports lately? The attack chain just assumes a pre-existing breach, then continues to frame normal and expectable behavior as a security issue.<\/p>\n<p>Some examples that were actually reported to me in the past:<\/p>\n<ul>\n<li>A web application serves static files from \u2026<\/li><\/ul>","content":"<p>Did you also notice a repeating pattern with AI security reports lately? The attack chain just assumes a pre-existing breach, then continues to frame normal and expectable behavior as a security issue.<\/p>\n<p>Some examples that were actually reported to me in the past:<\/p>\n<ul>\n<li>A web application serves static files from a specific <em>public<\/em> directory to users. If that directory contains a symlink to <code>\/etc\/passwd<\/code>, and the file is readable by the web server, an attacker may be able to request it and leak sensitive information.<\/li>\n<li>A web framework provides a method for adding custom headers to HTTP responses. If an application developer ignores all security practices and passes untrusted user input directly into response headers, and if the HTTP stack serving the application also ignores the spec and forwards headers with invalid characters to clients, then an attacker may use this for header injection or cache poisoning.<\/li>\n<li>Signed cookies are parsed with cPickle on the server side. If the signing key is leaked, malicious cookies may trigger RCE.<\/li>\n<li>An internal function decodes bytes to strings without catching UnicodeException. The report claims this could be used for denial-of-service attacks, but does not show how this exception could be triggered through any of the public APIs. The provided PoC calls the internal function directly, bypassing the safeguards that usually surround it.<\/li>\n<\/ul>\n<p><strong>All of these reports share a pattern: they assume a prior breach<\/strong> unrelated to the software under audit, or exploit conditions that violate the software's trust boundaries and assumptions, <strong>and then label the direct consequences of those fabricated preconditions as separate security issues<\/strong> in the audited software.<\/p>\n<p>Under fabricated conditions, even correct behavior can be exploited. Garbage in, garbage out. An API that assumes trusted input cannot be expected to magically detect and sanitize malicious input. <strong>A pencil can be used as a weapon, but that is not the pencils fault.<\/strong> Banning pencils or expecting them to break on impact does not improve security, it breaks pencils.<\/p>\n<p>There are exceptions, of course. If the reported issue is an actual bug or undefined behavior and can be used in an attack chain to drastically increase the impact of another common bug, then yes: it should be fixed. But does that make it a security issue that requires responsible disclosure and a CVE? Usually no. A public issue may be enough.<\/p>\n<p><strong>AI often ignores the threat model implied or defined by an API<\/strong> and fabricates preconditions that break with established trust boundaries or assumptions, just to be able to report a finding. In my experience, this happens most often when AI is explicitly asked to find vulnerabilities in software that does not have any obvious issues. It would rather hallucinate a finding than admit that it found nothing.<\/p>\n<p><strong>So when you use AI to audit software, or when you deal with AI-assisted security reports, here is a checklist:<\/strong><\/p>\n<ul>\n<li>Ask for a PoC that demonstrates the entire attack chain under realistic circumstances, or for tangible real-world examples of how the preconditions could happen by accident or be provoked by an attacker. If preconditions cannot be explained, they should not be assumed.<\/li>\n<li>If the preconditions assume insecure configuration, operation, or usage practices, check documentation and defaults. They should be clear and secure by default. It does not hurt to have <em>additional<\/em> runtime checks for common configuration or usage errors, but the absence of those checks is not automatically a security vulnerability. If someone wants to shoot themselves in the foot, they will always find a way.<\/li>\n<li>If the preconditions assume a prior breach, re-evaluate impact and severity after factoring out any out of scope conditions. Sometimes the preconditions are more severe than the actual finding, which drastically reduces the real impact. If the preconditions are completely unrealistic or out of scope, then the solution is also out of scope. We cannot fix bugs in other people's software.<\/li>\n<\/ul>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"infosec"}}]},{"title":"BigBlueButton error codes","link":{"@attributes":{"href":"https:\/\/defnull.de\/2026\/bigbluebutton-error-codes\/","rel":"alternate"}},"published":"2026-05-13T00:00:00+02:00","updated":"2026-05-13T00:00:00+02:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2026-05-13:\/2026\/bigbluebutton-error-codes\/","summary":"<p><a href=\"https:\/\/bigbluebutton.org\/\">BigBlueButton<\/a> sometimes show an error with a 4-digit number but no further explanation. I could not find a <em>complete<\/em> list online, so I dug into the sources (<a href=\"https:\/\/github.com\/bigbluebutton\/bigbluebutton\/blob\/02389767ce3f0df331e269e9662aff4a572cabca\/bigbluebutton-html5\/imports\/ui\/services\/bbb-webrtc-sfu\/broker-base-errors.js\">1<\/a>, <a href=\"https:\/\/github.com\/bigbluebutton\/bigbluebutton\/blob\/02389767ce3f0df331e269e9662aff4a572cabca\/bigbluebutton-html5\/imports\/api\/screenshare\/client\/bridge\/errors.js\">2<\/a>) and collected all error codes I could find:<\/p>\n<h2 id=\"1101-1121-client-errors\">1101 - 1121: Client errors<a class=\"headerlink\" href=\"#1101-1121-client-errors\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>Connection or media decoding issues detected by the client \u2026<\/p>","content":"<p><a href=\"https:\/\/bigbluebutton.org\/\">BigBlueButton<\/a> sometimes show an error with a 4-digit number but no further explanation. I could not find a <em>complete<\/em> list online, so I dug into the sources (<a href=\"https:\/\/github.com\/bigbluebutton\/bigbluebutton\/blob\/02389767ce3f0df331e269e9662aff4a572cabca\/bigbluebutton-html5\/imports\/ui\/services\/bbb-webrtc-sfu\/broker-base-errors.js\">1<\/a>, <a href=\"https:\/\/github.com\/bigbluebutton\/bigbluebutton\/blob\/02389767ce3f0df331e269e9662aff4a572cabca\/bigbluebutton-html5\/imports\/api\/screenshare\/client\/bridge\/errors.js\">2<\/a>) and collected all error codes I could find:<\/p>\n<h2 id=\"1101-1121-client-errors\">1101 - 1121: Client errors<a class=\"headerlink\" href=\"#1101-1121-client-errors\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>Connection or media decoding issues detected by the client, but not necessarily caused by the client.<\/p>\n<table>\n<thead>\n<tr>\n<th>Code<\/th>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1101<\/td>\n<td>SIGNALLING_TRANSPORT_DISCONNECTED<\/td>\n<td>Websocket connection interrupted or connection closed by the server.<\/td>\n<\/tr>\n<tr>\n<td>1102<\/td>\n<td>SIGNALLING_TRANSPORT_CONNECTION_FAILED<\/td>\n<td>Websocket failed to connect.<\/td>\n<\/tr>\n<tr>\n<td>1104<\/td>\n<td>SCREENSHARE_PLAY_FAILED<\/td>\n<td>Unable to decode video stream, usually caused by old browsers or missing video codecs.<\/td>\n<\/tr>\n<tr>\n<td>1105<\/td>\n<td>PEER_NEGOTIATION_FAILED<\/td>\n<td>WebRTC failed to establish a direct connection. UDP traffic is likely blocked by a firewall or NAT. If you have a TURN server and still get this error, then a firewall is also blocking TURN traffic.<\/td>\n<\/tr>\n<tr>\n<td>1107<\/td>\n<td>ICE_STATE_FAILED<\/td>\n<td>WebRTC connection closed or failed, and restarting ICE peer negotiation also failed.<\/td>\n<\/tr>\n<tr>\n<td>1110<\/td>\n<td>ENDED_WHILE_STARTING<\/td>\n<td>Old connection replaced by new one. This is usually ignored by clients.<\/td>\n<\/tr>\n<tr>\n<td>1120<\/td>\n<td>MEDIA_TIMEOUT<\/td>\n<td>Mediaserver not responding, which is usually a server-side issue.<\/td>\n<\/tr>\n<tr>\n<td>1121<\/td>\n<td>UNKNOWN_ERROR<\/td>\n<td>Unhandled or unknown errors.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"1130-1138-getdisplaymedia-errors\">1130 - 1138: GetDisplayMedia Errors<a class=\"headerlink\" href=\"#1130-1138-getdisplaymedia-errors\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>Issues while querying or accessing browser media sources. Those are usually caused by the browser or operating system blocking access to media sources, or by broken devices or device drivers that do not provide any compatible media formats.<\/p>\n<table>\n<thead>\n<tr>\n<th>Code<\/th>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1130<\/td>\n<td>GetDisplayMediaGenericError<\/td>\n<td>Unhandled or unknown errors.<\/td>\n<\/tr>\n<tr>\n<td>1131<\/td>\n<td>AbortError<\/td>\n<td>Operation aborted, likely by the user.<\/td>\n<\/tr>\n<tr>\n<td>1132<\/td>\n<td>InvalidStateError<\/td>\n<td>Media source is already being used exclusively by another application.<\/td>\n<\/tr>\n<tr>\n<td>1133<\/td>\n<td>OverconstrainedError<\/td>\n<td>Media source does not support any of the requested resolutions or framerates.<\/td>\n<\/tr>\n<tr>\n<td>1134<\/td>\n<td>TypeError<\/td>\n<td>Browser is too old or does not implement required browser features.<\/td>\n<\/tr>\n<tr>\n<td>1135<\/td>\n<td>NotFoundError<\/td>\n<td>No media sources found, or blocked by the operating system.<\/td>\n<\/tr>\n<tr>\n<td>1136<\/td>\n<td>NotAllowedError<\/td>\n<td>Access to media source denied by the browser or the user.<\/td>\n<\/tr>\n<tr>\n<td>1137<\/td>\n<td>NotSupportedError<\/td>\n<td>Browser is too old or does not implement required browser features.<\/td>\n<\/tr>\n<tr>\n<td>1138<\/td>\n<td>NotReadableError<\/td>\n<td>Media source found, but does not respond. Broken cable?<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"1301-1310-sfu-client-errors\">1301 - 1310: SFU CLient Errors<a class=\"headerlink\" href=\"#1301-1310-sfu-client-errors\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>Connection issues betwen client and media server (SFU). Those are usually reported as 11xx client-side errors (see above).<\/p>\n<table>\n<thead>\n<tr>\n<th>Code<\/th>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1301<\/td>\n<td>WEBSOCKET_DISCONNECTED<\/td>\n<td>See 1101<\/td>\n<\/tr>\n<tr>\n<td>1302<\/td>\n<td>WEBSOCKET_CONNECTION_FAILED<\/td>\n<td>See 1102<\/td>\n<\/tr>\n<tr>\n<td>1305<\/td>\n<td>PEER_NEGOTIATION_FAILED<\/td>\n<td>See 1105<\/td>\n<\/tr>\n<tr>\n<td>1307<\/td>\n<td>ICE_STATE_FAILED<\/td>\n<td>See 1107<\/td>\n<\/tr>\n<tr>\n<td>1310<\/td>\n<td>ENDED_WHILE_STARTING<\/td>\n<td>See 1110<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"2000-2300-sfu-server-errors\">2000 - 2300: SFU Server Errors<a class=\"headerlink\" href=\"#2000-2300-sfu-server-errors\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>Error codes returned by the media server (via SFU). Those are not necessary server-side errors, but errors detected and reported by the media server or SFU. Most are not reported to the user, but masked behind fatal errors.<\/p>\n<table>\n<thead>\n<tr>\n<th>Code<\/th>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>2000<\/td>\n<td>MEDIA_SERVER_CONNECTION_ERROR<\/td>\n<td>SFU fails to connect to media server.<\/td>\n<\/tr>\n<tr>\n<td>2001<\/td>\n<td>MEDIA_SERVER_OFFLINE<\/td>\n<td>Media server offline or crashed.<\/td>\n<\/tr>\n<tr>\n<td>2002<\/td>\n<td>MEDIA_SERVER_NO_RESOURCES<\/td>\n<td>Media server at maximum capacity.<\/td>\n<\/tr>\n<tr>\n<td>2003<\/td>\n<td>MEDIA_SERVER_REQUEST_TIMEOUT<\/td>\n<td>Media server overloaded or crashing.<\/td>\n<\/tr>\n<tr>\n<td>2004<\/td>\n<td>MEDIA_SERVER_GENERIC_ERROR<\/td>\n<td>Media server is broken and the SFU has no ideas what's happening.<\/td>\n<\/tr>\n<tr>\n<td>2020<\/td>\n<td>ICE_ADD_CANDIDATE_FAILED<\/td>\n<td>Invalid or blacklisted WebRTC connection candidate.<\/td>\n<\/tr>\n<tr>\n<td>2021<\/td>\n<td>ICE_GATHERING_FAILED<\/td>\n<td>No usable WebRTC connection candidates found.<\/td>\n<\/tr>\n<tr>\n<td>2022<\/td>\n<td>ICE_STATE_FAILED<\/td>\n<td>WebRTC connection failed to establish.<\/td>\n<\/tr>\n<tr>\n<td>2200<\/td>\n<td>MEDIA_GENERIC_ERROR<\/td>\n<td>Unhandled error related to media processing.<\/td>\n<\/tr>\n<tr>\n<td>2201<\/td>\n<td>MEDIA_NOT_FOUND<\/td>\n<td>Client requested a media stream that does not exist.<\/td>\n<\/tr>\n<tr>\n<td>2202<\/td>\n<td>MEDIA_INVALID_SDP<\/td>\n<td>Client provided invalid SDP (Session Description Protocol).<\/td>\n<\/tr>\n<tr>\n<td>2203<\/td>\n<td>MEDIA_NO_AVAILABLE_CODEC<\/td>\n<td>Client does not support any of the media codecs offered by the media server.<\/td>\n<\/tr>\n<tr>\n<td>2208<\/td>\n<td>MEDIA_GENERIC_PROCESS_ERROR<\/td>\n<td>Media processing (e.g. video transcoding) failed, likely caused by a client sending invalid data.<\/td>\n<\/tr>\n<tr>\n<td>2209<\/td>\n<td>MEDIA_ADAPTER_OBJECT_NOT_FOUND<\/td>\n<td>Internal media processing pipeline error.<\/td>\n<\/tr>\n<tr>\n<td>2210<\/td>\n<td>MEDIA_CONNECT_ERROR<\/td>\n<td>Internal media processing pipeline error.<\/td>\n<\/tr>\n<tr>\n<td>2211<\/td>\n<td>MEDIA_NOT_FLOWING<\/td>\n<td>Media pipeline stalled, likely caused by connection or bandwith issues.<\/td>\n<\/tr>\n<tr>\n<td>2300<\/td>\n<td>SFU_INVALID_REQUEST<\/td>\n<td>Client sends an invalid request to the SFU, which is likely a bug in BBB or a version mismatch between client and server components.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"BigBlueButton"}}]},{"title":"CVE-2026-28356 - multipart","link":{"@attributes":{"href":"https:\/\/defnull.de\/2026\/CVE-2026-28356_multipart\/","rel":"alternate"}},"published":"2026-03-14T00:00:00+01:00","updated":"2026-03-14T00:00:00+01:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2026-03-14:\/2026\/CVE-2026-28356_multipart\/","summary":"<p>The 'multipart' python library got an independent security audit and I only know about that because they found something -&gt; <a href=\"https:\/\/github.com\/defnull\/multipart\/security\/advisories\/GHSA-p2m9-wcp5-6qw3\">CVE-2026-28356<\/a><\/p>\n<p>This is great, actually! Someone looked into it so thoroughly that they found an obscure single-character issue in a regular expression ... and didn't find anything else! Which means I can \u2026<\/p>","content":"<p>The 'multipart' python library got an independent security audit and I only know about that because they found something -&gt; <a href=\"https:\/\/github.com\/defnull\/multipart\/security\/advisories\/GHSA-p2m9-wcp5-6qw3\">CVE-2026-28356<\/a><\/p>\n<p>This is great, actually! Someone looked into it so thoroughly that they found an obscure single-character issue in a regular expression ... and didn't find anything else! Which means I can now be really confident about the security of this library. Nice!<\/p>\n<p>I would have never found this myself, because I would have had no reason to look for it. It's a single character typo in a regular expression that has no effect on the intended functionality, but leads to catastrophic backtracking when fed with malicious input. Why typo? Because the same pattern is used twice, and only one of them was bad.<\/p>\n<p>The library has 100% test coverage, including malicious input scenarios. But for this kind of issues you'd need a fuzzer. Maybe I should look into fuzzing?<\/p>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"Python"}},{"@attributes":{"term":"infosec"}},{"@attributes":{"term":"CVE"}}]},{"title":"Introducing BBBLB","link":{"@attributes":{"href":"https:\/\/defnull.de\/2025\/BBBLB\/","rel":"alternate"}},"published":"2025-11-27T00:00:00+01:00","updated":"2025-11-27T00:00:00+01:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2025-11-27:\/2025\/BBBLB\/","summary":"<p>My latest FOSS Project: <a href=\"https:\/\/bbblb.readthedocs.io\">BBBLB<\/a> is a modern multi-tenant capable load balancer for large <a href=\"https:\/\/bigbluebutton.org\/\">BigBlueButton<\/a> clusters. Not ready for production yet, but on a good path. The aim is to have something fast and easy(er) to maintain that can fully replace scalelite (the reference implementation) and fixes some of \u2026<\/p>","content":"<p>My latest FOSS Project: <a href=\"https:\/\/bbblb.readthedocs.io\">BBBLB<\/a> is a modern multi-tenant capable load balancer for large <a href=\"https:\/\/bigbluebutton.org\/\">BigBlueButton<\/a> clusters. Not ready for production yet, but on a good path. The aim is to have something fast and easy(er) to maintain that can fully replace scalelite (the reference implementation) and fixes some of its long standing bugs and issues.<\/p>\n<ul>\n<li><a href=\"https:\/\/bbblb.readthedocs.io\">https:\/\/bbblb.readthedocs.io<\/a>  <\/li>\n<li><a href=\"https:\/\/github.com\/defnull\/bbblb\">https:\/\/github.com\/defnull\/bbblb<\/a>  <\/li>\n<li><a href=\"https:\/\/codeberg.org\/defnull\/bbblb\">https:\/\/codeberg.org\/defnull\/bbblb<\/a>  <\/li>\n<\/ul>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"FOSS"}},{"@attributes":{"term":"BigBlueButton"}},{"@attributes":{"term":"BBBLB"}},{"@attributes":{"term":"Python"}}]},{"title":"Python yarl (aiohttp) breaks URLs","link":{"@attributes":{"href":"https:\/\/defnull.de\/2025\/aiohttp-bug\/","rel":"alternate"}},"published":"2025-11-03T00:00:00+01:00","updated":"2025-11-03T00:00:00+01:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2025-11-03:\/2025\/aiohttp-bug\/","summary":"<p>The python <a href=\"https:\/\/pypi.org\/project\/aiohttp\/\">aiohttp<\/a> library uses <a href=\"https:\/\/pypi.org\/project\/yarl\/\">yarl<\/a> for URLs internally, and yarl normalizes URLs by default. It silently decodes some %-encoded characters in the query string that do not strictly need to be encoded.<\/p>\n<p>Sounds harmless, but it isn't. Changing the URL breaks any protocol that signs important aspects of a \u2026<\/p>","content":"<p>The python <a href=\"https:\/\/pypi.org\/project\/aiohttp\/\">aiohttp<\/a> library uses <a href=\"https:\/\/pypi.org\/project\/yarl\/\">yarl<\/a> for URLs internally, and yarl normalizes URLs by default. It silently decodes some %-encoded characters in the query string that do not strictly need to be encoded.<\/p>\n<p>Sounds harmless, but it isn't. Changing the URL breaks any protocol that signs important aspects of a HTTP request for security.<\/p>\n<p>Took me a while to find this bug. I usually expect an HTTP client library to not silently manipulate the URLs before sending a request. Smarter is not always better<\/p>\n<p>Yes, this is documented behavior, but I rarely read the documentation for HTTP client libraries. I know how HTTP works, I know how those libraries should work, and silently altering URLs without any need is something I really did not expect from a low level HTTP lib.<\/p>\n<p>Imagine <code>curl<\/code> would silently change the order of headers or query parameters or remove an explicitly defined content-length header because it decides that chunked transfer is better for you. Stuff would break.<\/p>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"yarl"}},{"@attributes":{"term":"aiohttp"}},{"@attributes":{"term":"Python"}}]},{"title":"Workaround for uv\/uvx future import bug","link":{"@attributes":{"href":"https:\/\/defnull.de\/2025\/uv-future-import-syntaxerror\/","rel":"alternate"}},"published":"2025-06-25T00:00:00+02:00","updated":"2025-06-25T00:00:00+02:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2025-06-25:\/2025\/uv-future-import-syntaxerror\/","summary":"<p>The <code>uv<\/code> and <code>uvx<\/code> tools have a very particular way to make virtual environments relocateable: they replace the shebang in python scripts with some polyglot magic, so that the executable is both a valid bash script and a python script at the same time. Unfortunately this breaks with a <code>SyntaxError \u2026<\/code><\/p>","content":"<p>The <code>uv<\/code> and <code>uvx<\/code> tools have a very particular way to make virtual environments relocateable: they replace the shebang in python scripts with some polyglot magic, so that the executable is both a valid bash script and a python script at the same time. Unfortunately this breaks with a <code>SyntaxError<\/code> if the original script uses <code>from future import ...<\/code> in certain ways. The bug is known and documented in <a href=\"https:\/\/github.com\/astral-sh\/uv\/issues\/6489\">Issue #6489<\/a> but unresolved since August 2024. There is a workaround, tough.<\/p>\n<h2 id=\"the-issue\">The issue<a class=\"headerlink\" href=\"#the-issue\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>This very simple script breaks when installed via uv\/uvx:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"ch\">#!\/usr\/bin\/env python<\/span>\n<span class=\"sd\">&#39;&#39;&#39; Module docstring &#39;&#39;&#39;<\/span>\n<span class=\"kn\">from<\/span><span class=\"w\"> <\/span><span class=\"nn\">__future__<\/span><span class=\"w\"> <\/span><span class=\"kn\">import<\/span> <span class=\"n\">print_function<\/span>\n<\/code><\/pre><\/div>\n\n<p>because uv\/uvx turns it into:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"ch\">#!\/bin\/sh<\/span>\n<span class=\"sd\">&#39;&#39;&#39;exec&#39; &quot;$(dirname -- &quot;$(realpath -- &quot;$0&quot;)&quot;)&quot;\/&#39;python&#39; &quot;$0&quot; &quot;$@&quot;<\/span>\n<span class=\"sd\">&#39; &#39;&#39;&#39;<\/span>\n<span class=\"sd\">&#39;&#39;&#39; Module docstring &#39;&#39;&#39;<\/span>\n<span class=\"kn\">from<\/span><span class=\"w\"> <\/span><span class=\"nn\">__future__<\/span><span class=\"w\"> <\/span><span class=\"kn\">import<\/span> <span class=\"n\">print_function<\/span>\n<\/code><\/pre><\/div>\n\n<p>which triggers <code>SyntaxError: from __future__ imports must occur at the beginning of the file<\/code>. Module strings are exempt from this parser rule, so the original script would execute without any issues. But now after uv\/uvx injected additional polygot code at the top, there are now two statements in front of the future-import and only the first one counts as a module docstring.<\/p>\n<h2 id=\"the-workaround\">The workaround<a class=\"headerlink\" href=\"#the-workaround\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>If you are maintaining a module or tool affected by this, there is a workaround: Move the <code>from __future__ import ...<\/code> line above your own module docstring. It must be the very first non-comment statement in the file. This way, the string injected by uv\/uvx will count as the new module-docstring and not as a forbidden statements before the future-import. As long as there is only one string before the future-import, the parser won't complain.<\/p>\n<p>This works:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"ch\">#!\/usr\/bin\/env python<\/span>\n<span class=\"kn\">from<\/span><span class=\"w\"> <\/span><span class=\"nn\">__future__<\/span><span class=\"w\"> <\/span><span class=\"kn\">import<\/span> <span class=\"n\">print_function<\/span>\n<span class=\"sd\">&#39;&#39;&#39; module docstring &#39;&#39;&#39;<\/span>\n<\/code><\/pre><\/div>\n\n<p>because uv\/uvx turns it into:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"ch\">#!\/bin\/sh<\/span>\n<span class=\"sd\">&#39;&#39;&#39;exec&#39; &quot;$(dirname -- &quot;$(realpath -- &quot;$0&quot;)&quot;)&quot;\/&#39;python&#39; &quot;$0&quot; &quot;$@&quot;<\/span>\n<span class=\"sd\">&#39; &#39;&#39;&#39;<\/span>\n<span class=\"kn\">from<\/span><span class=\"w\"> <\/span><span class=\"nn\">__future__<\/span><span class=\"w\"> <\/span><span class=\"kn\">import<\/span> <span class=\"n\">print_function<\/span>\n<span class=\"sd\">&#39;&#39;&#39; module docstring &#39;&#39;&#39;<\/span>\n<\/code><\/pre><\/div>\n\n<p>which is ugly and may confuse <code>help()<\/code>, IDEs and documentation generators, but at least it is not a <code>SyntaxError<\/code>.<\/p>\n<p>Hope this helps someone.<\/p>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"Python"}},{"@attributes":{"term":"uv"}}]},{"title":"Fediwall easter egg","link":{"@attributes":{"href":"https:\/\/defnull.de\/2025\/fediwall-whack\/","rel":"alternate"}},"published":"2025-06-07T00:00:00+02:00","updated":"2025-06-07T00:00:00+02:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2025-06-07:\/2025\/fediwall-whack\/","content":"<p>Go to <a href=\"https:\/\/fediwall.social\/\">https:\/\/fediwall.social\/<\/a> and press 'w' :D<\/p>\n<p>Sorry, no mobile support for this ultra useful feature, but it wouldn't look good on mobile anyway. Go touch some keyboards.<\/p>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"Fediwall"}}]},{"title":"Coffee machine design flaw","link":{"@attributes":{"href":"https:\/\/defnull.de\/2025\/coffee-bug\/","rel":"alternate"}},"published":"2025-04-17T00:00:00+02:00","updated":"2025-04-17T00:00:00+02:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2025-04-17:\/2025\/coffee-bug\/","summary":"<p>Coffee machine design flaw: My coffee maker has a floating magnet in its water tank and a reed switch to detect low water levels. The problem is that the machine stops immediately when this sensor is triggered, even in the middle of making a coffee and with enough water left \u2026<\/p>","content":"<p>Coffee machine design flaw: My coffee maker has a floating magnet in its water tank and a reed switch to detect low water levels. The problem is that the machine stops immediately when this sensor is triggered, even in the middle of making a coffee and with enough water left to complete the process.<\/p>\n<p>The sensor could have been placed higher up and only block <em>new<\/em> brewing processes. They could have installed two sensors, one for a warning light and one for the emergency shutdown. Or made the front of the tank transparent.<\/p>\n<p>But no, instead I pour away what feels like every fourth coffee, or I have to pull out the tank every single time to check manually. This annoys me more than it should.<\/p>\n<p>I get that this sensor is probably a required safety feature and not a convenience feature, and I did not pay enough for a machine that values my convenience in addition to safety regulations. But the perfect solution (two sensors) would have only cost a couple of cents and less than 10 additional lines in  the firmware.<\/p>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"Coffee"}}]},{"title":"Hello OpenVox","link":{"@attributes":{"href":"https:\/\/defnull.de\/2025\/openvox\/","rel":"alternate"}},"published":"2025-04-07T00:00:00+02:00","updated":"2025-04-07T00:00:00+02:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2025-04-07:\/2025\/openvox\/","summary":"<p>Today is the day. <a href=\"https:\/\/www.puppet.com\/\">Puppet<\/a> is dead, long live <a href=\"https:\/\/voxpupuli.org\/openvox\/\">OpenVox<\/a>!<\/p>\n<p>Background: Perforce bought Puppet in 2022, betrayed the FOSS community and changed the license. This resulted in a fork called <a href=\"https:\/\/github.com\/openvoxproject\">OpenVoxProject<\/a>, but old puppet releases still worked, so many admins did not care enough to switch.<\/p>\n<p>Yesterday the release key \u2026<\/p>","content":"<p>Today is the day. <a href=\"https:\/\/www.puppet.com\/\">Puppet<\/a> is dead, long live <a href=\"https:\/\/voxpupuli.org\/openvox\/\">OpenVox<\/a>!<\/p>\n<p>Background: Perforce bought Puppet in 2022, betrayed the FOSS community and changed the license. This resulted in a fork called <a href=\"https:\/\/github.com\/openvoxproject\">OpenVoxProject<\/a>, but old puppet releases still worked, so many admins did not care enough to switch.<\/p>\n<p>Yesterday the release key for the free puppet packages expired. It is unlikely that they will renew those keys.<\/p>\n<p>It's time to move on. <a href=\"https:\/\/voxpupuli.org\/openvox\/\">OpenVox<\/a> is a drop-in replacement. FOSS saved the day again!<\/p>\n<p>When I say 'drop-in replacement' I mean it: OpenVox 7.x up to 8.11 is functionally equivalent to Puppet. The commands and configuration files are the same. You just uninstall <code>puppet-agent<\/code>, install <code>openvox-agent<\/code>, and that's it. There is absolutely no reason to pay Perforce for a license or access to software that should be open source.<\/p>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"FOSS"}}]},{"title":"Hidden complexity in BBB 3.0-RC4","link":{"@attributes":{"href":"https:\/\/defnull.de\/2025\/bbb-hasura-graphql\/","rel":"alternate"}},"published":"2025-02-22T00:00:00+01:00","updated":"2026-05-18T00:00:00+02:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2025-02-22:\/2025\/bbb-hasura-graphql\/","summary":"<p>I recently experimented with <a href=\"https:\/\/github.com\/bigbluebutton\/bigbluebutton\/\">BigBlueButton 3.0-RC4<\/a> again and tried do find out why <code>hasura-graphql-server<\/code> and <code>postgresql<\/code> are hogging half a CPU all the time on a fresh BBB server with just a single meeting and only one participant. This seems to be less of an issue if you actually \u2026<\/p>","content":"<p>I recently experimented with <a href=\"https:\/\/github.com\/bigbluebutton\/bigbluebutton\/\">BigBlueButton 3.0-RC4<\/a> again and tried do find out why <code>hasura-graphql-server<\/code> and <code>postgresql<\/code> are hogging half a CPU all the time on a fresh BBB server with just a single meeting and only one participant. This seems to be less of an issue if you actually have some traffic on the server because it certainly scale better with more users, but I was still curious and wanted to understand how this GraphQL stuff works in BBB. Oh boy what an adventure!<\/p>\n<p><strong>Disclaimer:<\/strong> I know that BigBlueButton 3.0 was a ton of work and that it must have been a real pain to rip out and replace all the legacy meteor stuff for a project this size. I do not want to criticize the decision that were made or the work of individual developers. Taking shortcuts and priorizing developer experience over performance is fine! Sometimes this is necessary to reach a goal with a limited time budget. I just want to express my surprise and concerns when I noticed how much complexity and overhead is burried below the surface. The core developers probably know most of this already, and I hope some of those issues can be tackled in future releases.<\/p>\n<p><strong>Update 2026<\/strong>: The situation improved significantly since this article was written and the performance issues were all resolved.<\/p>\n<p>So, lets pick a (not really) random example and go on an adventure, shall we? Let's look at how BBB implements a \"shared mouse cursor\" that can be seen on the whiteboard by all participants of a meeting. A simple feature, you might think.<\/p>\n<h2 id=\"clientserver-communication\">Client\/Server communication<a class=\"headerlink\" href=\"#clientserver-communication\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>A meeting has lots of state that need to be shared with and synced between all connected clients, preferrably in real time. Stuff like, who is in the meeting? Who is currently talking? Chat messages, white board annotations and much more. In BigBlueButton 2.x this was achieved by building the client on top of <a href=\"https:\/\/www.meteor.com\/\">Meteor<\/a> and <a href=\"https:\/\/www.mongodb.com\/\">MongoDB<\/a>. Meteor is a pretty good fit for apps that need this kind of state synchronization. Unfortunately, <a href=\"https:\/\/www.mongodb.com\/legal\/licensing\/server-side-public-license\/faq\">MongoDB stopped beeing free software<\/a> a while ago and meteor was slow (the way it was used in BBB). Many bottlenecks for large meetings were blamed on Meteor, so it was replaced. Obviously, ripping out a framework and replacing it with something completely different is a ton of work, so choices were made and shortcuts were taken to make this possible at all without a full rewrite.<\/p>\n<p>In BigBlueButton 3, meteor was replaced with a <a href=\"https:\/\/hasura.io\/\">Hasura<\/a>, an 'universal data access layer' that speaks <a href=\"https:\/\/graphql.org\/\">GraphQL<\/a> and is backed by a database. The clients connects to a websocket and can trigger <em>mutations<\/em> on state, or <em>subscribe<\/em> to state changes, both via GraphQL. This is also used to synchronize mouse cursor positions, exactly what we are interested in today. <\/p>\n<p>So, what happens when the presenter in a meeting moves the mouse cursor two pixels to the left? The client calls an innocent looking function named <code>presentationPublishCursor()<\/code> which sends half a kilobyte of JSON over the Hasura websocket:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"p\">{<\/span>\n<span class=\"w\">    <\/span><span class=\"nt\">&quot;id&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;39980c1d-e8e5-45d5-8119-564828dca33d&quot;<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">    <\/span><span class=\"nt\">&quot;type&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;subscribe&quot;<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">    <\/span><span class=\"nt\">&quot;payload&quot;<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"p\">{<\/span>\n<span class=\"w\">        <\/span><span class=\"nt\">&quot;variables&quot;<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"p\">{<\/span>\n<span class=\"w\">            <\/span><span class=\"nt\">&quot;whiteboardId&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;2ef9c352f79b9bc20c4b9caaf5faeaca9dae7432-1740219557083\/1&quot;<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">            <\/span><span class=\"nt\">&quot;xPercent&quot;<\/span><span class=\"p\">:<\/span><span class=\"mf\">919.0178734915596<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">            <\/span><span class=\"nt\">&quot;yPercent&quot;<\/span><span class=\"p\">:<\/span><span class=\"mf\">115.98215103149414<\/span>\n<span class=\"w\">        <\/span><span class=\"p\">},<\/span>\n<span class=\"w\">        <\/span><span class=\"nt\">&quot;extensions&quot;<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"p\">{},<\/span>\n<span class=\"w\">        <\/span><span class=\"nt\">&quot;operationName&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;PresentationPublishCursor&quot;<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">        <\/span><span class=\"nt\">&quot;query&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;mutation PresentationPublishCursor($whiteboardId: String!, $xPercent: Float!, $yPercent: Float!) {\\n  presentationPublishCursor(\\n    whiteboardId: $whiteboardId\\n    xPercent: $xPercent\\n    yPercent: $yPercent\\n  )\\n}&quot;<\/span>\n<span class=\"w\">    <\/span><span class=\"p\">}<\/span>\n<span class=\"p\">}<\/span>\n<\/code><\/pre><\/div>\n\n<p>This <em>mutation<\/em> of state is parsed and processed by the server and then acknowledged with two responses:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"p\">{<\/span><span class=\"nt\">&quot;id&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;39980c1d-e8e5-45d5-8119-564828dca33d&quot;<\/span><span class=\"p\">,<\/span><span class=\"nt\">&quot;payload&quot;<\/span><span class=\"p\">:{<\/span><span class=\"nt\">&quot;data&quot;<\/span><span class=\"p\">:{<\/span><span class=\"nt\">&quot;presentationPublishCursor&quot;<\/span><span class=\"p\">:<\/span><span class=\"kc\">true<\/span><span class=\"p\">}},<\/span><span class=\"nt\">&quot;type&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;next&quot;<\/span><span class=\"p\">}<\/span>\n<span class=\"p\">{<\/span><span class=\"nt\">&quot;id&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;39980c1d-e8e5-45d5-8119-564828dca33d&quot;<\/span><span class=\"p\">,<\/span><span class=\"nt\">&quot;type&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;complete&quot;<\/span><span class=\"p\">}<\/span>\n<\/code><\/pre><\/div>\n\n<p>This happens once every 150ms by default, which is a lot, but required if you want somewhat smooth cursor movement. Every 250ms or so all clients are notified about the new cursor position, which looks like this:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"p\">{<\/span>\n<span class=\"w\">    <\/span><span class=\"nt\">&quot;type&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;next&quot;<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">    <\/span><span class=\"nt\">&quot;id&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;c51e8701-6282-479d-a4ae-131056cf95ba&quot;<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">    <\/span><span class=\"nt\">&quot;payload&quot;<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"p\">{<\/span>\n<span class=\"w\">        <\/span><span class=\"nt\">&quot;data&quot;<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"p\">{<\/span>\n<span class=\"w\">            <\/span><span class=\"nt\">&quot;pres_page_cursor_stream&quot;<\/span><span class=\"w\"> <\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"p\">[{<\/span>\n<span class=\"w\">                <\/span><span class=\"nt\">&quot;xPercent&quot;<\/span><span class=\"p\">:<\/span><span class=\"mf\">795.803587777274<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">                <\/span><span class=\"nt\">&quot;yPercent&quot;<\/span><span class=\"p\">:<\/span><span class=\"mf\">83.839293888637<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">                <\/span><span class=\"nt\">&quot;lastUpdatedAt&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;2025-02-22T10:19:53.119+00:00&quot;<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">                <\/span><span class=\"nt\">&quot;userId&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;w_zbduowqxzbyo&quot;<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">                <\/span><span class=\"nt\">&quot;__typename&quot;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&quot;pres_page_cursor&quot;<\/span>\n<span class=\"w\">            <\/span><span class=\"p\">}]<\/span>\n<span class=\"w\">        <\/span><span class=\"p\">}<\/span>\n<span class=\"w\">    <\/span><span class=\"p\">}<\/span>\n<span class=\"p\">}<\/span>\n<\/code><\/pre><\/div>\n\n<p>So far, so good. A bit verbose perhaps, and there is some network and parsing overhead, but that does not explain why both <code>hasura-graphql-server<\/code> and <code>postgresql<\/code> are busy enough to use half a CPU all the time.<\/p>\n<h2 id=\"lots-of-sql-under-the-hood\">Lots of SQL under the hood<a class=\"headerlink\" href=\"#lots-of-sql-under-the-hood\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>So, what happens on the server side? Let's go deeper.<\/p>\n<p>As already mentioned, BigBlueButton 3.0 switched from <a href=\"https:\/\/www.meteor.com\/\">Meteor<\/a> to <a href=\"https:\/\/hasura.io\/\">Hasura<\/a> to manage and sync state between clients. In this configuration, Hasura stores all its state (and also non-state, more on that later) in a <a href=\"https:\/\/www.postgresql.org\/\">postgresql<\/a> database. That's nice, postgres is really great. But an odd choice for real-time data you may think. Isn't something like <a href=\"https:\/\/redis.io\/\">redis<\/a> way more common for this use case?<\/p>\n<p>When looking at the sources, it's obvious that most of the server code, query logic and database schema were not hand-crafted by developers, but generated by Hasura tooling based on configuration snippets <a href=\"https:\/\/github.com\/bigbluebutton\/bigbluebutton\/blob\/v3.0.0-rc.4\/bbb-graphql-server\/metadata\/databases\/BigBlueButton\/tables\/public_v_pres_page_cursor.yaml\">like these<\/a>. At least I hope so, because the <a href=\"https:\/\/github.com\/bigbluebutton\/bigbluebutton\/blob\/v3.0.0-rc.4\/bbb-graphql-server\/bbb_schema.sql\">resulting DB schema<\/a> is huge!<\/p>\n<p>Using a framerwork like Hasura does make sense in this context. It can speed up development and allow developers focus on features while the framework hanles all the details. I somewhat understand and do not really question this choice. Sometimes you have to resort to these tools to get things done. But they come at a price: <strong>The table responsible for mouse movements has 6 columns, 5 indices and two foreign keys, most of them a compound keys<\/strong>. Oh, and there is a view that joins it with two additional tables. Yes, really:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"k\">CREATE<\/span><span class=\"w\"> <\/span><span class=\"k\">TABLE<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;pres_page_cursor&quot;<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span>\n<span class=\"w\">    <\/span><span class=\"ss\">&quot;pageId&quot;<\/span><span class=\"w\"> <\/span><span class=\"nb\">varchar<\/span><span class=\"p\">(<\/span><span class=\"mi\">100<\/span><span class=\"p\">)<\/span><span class=\"w\">  <\/span><span class=\"k\">REFERENCES<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;pres_page&quot;<\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;pageId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">ON<\/span><span class=\"w\"> <\/span><span class=\"k\">DELETE<\/span><span class=\"w\"> <\/span><span class=\"k\">CASCADE<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">    <\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"w\"> <\/span><span class=\"nb\">varchar<\/span><span class=\"p\">(<\/span><span class=\"mi\">100<\/span><span class=\"p\">),<\/span>\n<span class=\"w\">    <\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"w\"> <\/span><span class=\"nb\">varchar<\/span><span class=\"p\">(<\/span><span class=\"mi\">50<\/span><span class=\"p\">),<\/span>\n<span class=\"w\">    <\/span><span class=\"ss\">&quot;xPercent&quot;<\/span><span class=\"w\"> <\/span><span class=\"nb\">numeric<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">    <\/span><span class=\"ss\">&quot;yPercent&quot;<\/span><span class=\"w\"> <\/span><span class=\"nb\">numeric<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">    <\/span><span class=\"ss\">&quot;lastUpdatedAt&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">timestamp<\/span><span class=\"w\"> <\/span><span class=\"k\">with<\/span><span class=\"w\"> <\/span><span class=\"k\">time<\/span><span class=\"w\"> <\/span><span class=\"k\">zone<\/span><span class=\"w\"> <\/span><span class=\"k\">DEFAULT<\/span><span class=\"w\"> <\/span><span class=\"n\">now<\/span><span class=\"p\">(),<\/span>\n<span class=\"w\">    <\/span><span class=\"k\">CONSTRAINT<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;pres_page_cursor_pkey&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">PRIMARY<\/span><span class=\"w\"> <\/span><span class=\"k\">KEY<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;pageId&quot;<\/span><span class=\"p\">,<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">,<\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"p\">),<\/span>\n<span class=\"w\">    <\/span><span class=\"k\">FOREIGN<\/span><span class=\"w\"> <\/span><span class=\"k\">KEY<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">REFERENCES<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;user&quot;<\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">,<\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">ON<\/span><span class=\"w\"> <\/span><span class=\"k\">DELETE<\/span><span class=\"w\"> <\/span><span class=\"k\">CASCADE<\/span>\n<span class=\"p\">);<\/span>\n<span class=\"k\">create<\/span><span class=\"w\"> <\/span><span class=\"k\">index<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;idx_pres_page_cursor_pageId&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">on<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;pres_page_cursor&quot;<\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;pageId&quot;<\/span><span class=\"p\">);<\/span>\n<span class=\"k\">create<\/span><span class=\"w\"> <\/span><span class=\"k\">index<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;idx_pres_page_cursor_userID&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">on<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;pres_page_cursor&quot;<\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">,<\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"p\">);<\/span>\n<span class=\"k\">create<\/span><span class=\"w\"> <\/span><span class=\"k\">index<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;idx_pres_page_cursor_userID_rev&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">on<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;pres_page_cursor&quot;<\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">);<\/span>\n<span class=\"k\">create<\/span><span class=\"w\"> <\/span><span class=\"k\">index<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;idx_pres_page_cursor_lastUpdatedAt&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">on<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;pres_page_cursor&quot;<\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;pageId&quot;<\/span><span class=\"p\">,<\/span><span class=\"ss\">&quot;lastUpdatedAt&quot;<\/span><span class=\"p\">);<\/span>\n\n<span class=\"k\">CREATE<\/span><span class=\"w\"> <\/span><span class=\"k\">VIEW<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;v_pres_page_cursor&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span>\n<span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"n\">pres_page<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;presentationId&quot;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"k\">c<\/span><span class=\"p\">.<\/span><span class=\"o\">*<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">        <\/span><span class=\"k\">CASE<\/span><span class=\"w\"> <\/span><span class=\"k\">WHEN<\/span><span class=\"w\"> <\/span><span class=\"n\">pres_presentation<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;current&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">IS<\/span><span class=\"w\"> <\/span><span class=\"k\">true<\/span><span class=\"w\"> <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"n\">pres_page<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;current&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">IS<\/span><span class=\"w\"> <\/span><span class=\"k\">true<\/span><span class=\"w\"> <\/span><span class=\"k\">THEN<\/span><span class=\"w\"> <\/span><span class=\"k\">true<\/span><span class=\"w\"> <\/span><span class=\"k\">ELSE<\/span><span class=\"w\"> <\/span><span class=\"k\">false<\/span><span class=\"w\"> <\/span><span class=\"k\">END<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;isCurrentPage&quot;<\/span>\n<span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"n\">pres_page_cursor<\/span><span class=\"w\"> <\/span><span class=\"k\">c<\/span>\n<span class=\"k\">JOIN<\/span><span class=\"w\"> <\/span><span class=\"n\">pres_page<\/span><span class=\"w\"> <\/span><span class=\"k\">ON<\/span><span class=\"w\"> <\/span><span class=\"n\">pres_page<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;pageId&quot;<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"k\">c<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;pageId&quot;<\/span>\n<span class=\"k\">JOIN<\/span><span class=\"w\"> <\/span><span class=\"n\">pres_presentation<\/span><span class=\"w\"> <\/span><span class=\"k\">ON<\/span><span class=\"w\"> <\/span><span class=\"n\">pres_presentation<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;presentationId&quot;<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"n\">pres_page<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;presentationId&quot;<\/span><span class=\"p\">;<\/span>\n<\/code><\/pre><\/div>\n\n<p>You may already have a bad feeling and an idea what this means, and you are right: for every single meeting, every 150ms, this table is updated with new values and synced to disk. This is not an in-memory table by the way. This is a real table with full <a href=\"https:\/\/en.wikipedia.org\/wiki\/ACID\">ACID<\/a> guarantees in a relational database. If the server crashes, your last mouse movement will be save! What a relief!<\/p>\n<p>To be fair, this is a particularly bad example. Mouse movements are low priority high frequency events. Those do not need to be persisted at all, let alone synced to disk. Connected clients know the last position and new clients can simply wait for the next event to catch up. Most other state tracked in that DB is different: the current slide for example is actual state that needs to be communicated to new clients as soon as they connect, so it needs to be stored somewhere. But on disk? In a relational database?<\/p>\n<p>This is not much data we are talking about, maybe a couple of KB per meeting. Even on a heavily utilized BBB server, it would fit comfortably in memory. Using <a href=\"https:\/\/www.postgresql.org\/docs\/current\/sql-createtable.html#SQL-CREATETABLE-UNLOGGED\">UNLOGGED<\/a> tables for unimportant data may help reduce the IO load a little, but it's still the wrong tool for the job in my optinion. At least for high frequency data like mouse movements or whiteboard drawings. <\/p>\n<h2 id=\"not-enough-sql-hold-my-beer-and-watch-the-query-log\">Not enough SQL? Hold my beer and watch (the query log)<a class=\"headerlink\" href=\"#not-enough-sql-hold-my-beer-and-watch-the-query-log\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>All this sill does not explain why the database is so busy all the time, even if nothing really happens and there is only one empty meeting on the server. So, what's causing all this load?<\/p>\n<p>Earlier we saw that the updated cursor position is a <code>\"type\":\"next\"<\/code> event. This is the result of a GraphQL query with more than one result, in this case a <a href=\"https:\/\/graphql.org\/learn\/subscriptions\/\">GraphQL subscription<\/a>. You request data from the server, and want to be notified whenever the result of your query changes. That's a pretty straight forward way to implement synchronized state.<\/p>\n<p>So, how does Hasura know when the result of a complex GraphQL query changed? I'm pretty sure that there are better ways to do this, and maybe this is just an configuration issue, but at the time of writing <strong>Hasura seems to just query the database over and over again in a fast loop<\/strong>. Now, if you look at one of those queries, you quickly understand why the database is busy all the time. I gave up trying to format and make sense of this absurdity. Here it is, in all its glory:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;__subs&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;result_id&quot;<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">       <\/span><span class=\"ss\">&quot;__fld_resp&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;root&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;result&quot;<\/span>\n<span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"k\">UNNEST<\/span><span class=\"p\">((<\/span><span class=\"err\">$<\/span><span class=\"mi\">1<\/span><span class=\"p\">)::<\/span><span class=\"n\">UUID<\/span><span class=\"p\">[],<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"err\">$<\/span><span class=\"mi\">2<\/span><span class=\"p\">)::<\/span><span class=\"n\">JSON<\/span><span class=\"p\">[])<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;__subs&quot;<\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;result_id&quot;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;result_vars&quot;<\/span><span class=\"p\">)<\/span>\n<span class=\"k\">LEFT<\/span><span class=\"w\"> <\/span><span class=\"k\">OUTER<\/span><span class=\"w\"> <\/span><span class=\"k\">JOIN<\/span><span class=\"w\"> <\/span><span class=\"k\">LATERAL<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span>\n<span class=\"w\">    <\/span><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"n\">json_build_object<\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;pres_page_cursor&#39;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_pres_page_cursor&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;root&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;root&quot;<\/span>\n<span class=\"w\">    <\/span><span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span>\n<span class=\"w\">        <\/span><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"k\">coalesce<\/span><span class=\"p\">(<\/span><span class=\"n\">json_agg<\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;root&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">ORDER<\/span><span class=\"w\"> <\/span><span class=\"k\">BY<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;root.pg.userId&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">ASC<\/span><span class=\"w\"> <\/span><span class=\"n\">NULLS<\/span><span class=\"w\"> <\/span><span class=\"k\">LAST<\/span><span class=\"p\">),<\/span><span class=\"w\"> <\/span><span class=\"s1\">&#39;[]&#39;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;root&quot;<\/span>\n<span class=\"w\">        <\/span><span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span>\n<span class=\"w\">            <\/span><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"n\">row_to_json<\/span><span class=\"p\">((<\/span>\n<span class=\"w\">                <\/span><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_e&quot;<\/span>\n<span class=\"w\">                <\/span><span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span>\n<span class=\"w\">                    <\/span><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_root.base&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_root.or.user&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;user&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;user&quot;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"s1\">&#39;pres_page_cursor&#39;<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;__typename&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_e&quot;<\/span><span class=\"p\">))<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;root&quot;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_root.base&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;root.pg.userId&quot;<\/span>\n<span class=\"w\">                    <\/span><span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span>\n<span class=\"w\">                        <\/span><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"o\">*<\/span>\n<span class=\"w\">                        <\/span><span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_pres_page_cursor&quot;<\/span>\n<span class=\"w\">                        <\/span><span class=\"k\">WHERE<\/span><span class=\"w\"> <\/span><span class=\"p\">(((((<\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_pres_page_cursor&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"ss\">&quot;__subs&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;result_vars&quot;<\/span><span class=\"o\">#&gt;&gt;<\/span><span class=\"nb\">ARRAY<\/span><span class=\"p\">[<\/span><span class=\"s1\">&#39;session&#39;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"s1\">&#39;x-hasura-meetingid&#39;<\/span><span class=\"p\">]))::<\/span><span class=\"nb\">varchar<\/span><span class=\"p\">))<\/span>\n<span class=\"w\">                            <\/span><span class=\"k\">OR<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_pres_page_cursor&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">IS<\/span><span class=\"w\"> <\/span><span class=\"k\">NULL<\/span><span class=\"p\">)<\/span>\n<span class=\"w\">                            <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">((((<\/span><span class=\"ss\">&quot;__subs&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;result_vars&quot;<\/span><span class=\"o\">#&gt;&gt;<\/span><span class=\"nb\">ARRAY<\/span><span class=\"p\">[<\/span><span class=\"s1\">&#39;session&#39;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"s1\">&#39;x-hasura-meetingid&#39;<\/span><span class=\"p\">]))::<\/span><span class=\"nb\">varchar<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">IS<\/span><span class=\"w\"> <\/span><span class=\"k\">NULL<\/span><span class=\"p\">)))<\/span>\n<span class=\"w\">                            <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">((<\/span><span class=\"k\">EXISTS<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span>\n<span class=\"w\">                                <\/span><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"mi\">1<\/span>\n<span class=\"w\">                                <\/span><span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_user_ref&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;__be_0_v_user_ref&quot;<\/span>\n<span class=\"w\">                                <\/span><span class=\"k\">WHERE<\/span><span class=\"w\"> <\/span><span class=\"p\">((((<\/span><span class=\"ss\">&quot;__be_0_v_user_ref&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_pres_page_cursor&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"p\">))<\/span>\n<span class=\"w\">                                    <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"ss\">&quot;__be_0_v_user_ref&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_pres_page_cursor&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">))<\/span>\n<span class=\"w\">                                    <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;true&#39;<\/span><span class=\"p\">)))<\/span>\n<span class=\"w\">                                    <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">((<\/span><span class=\"s1\">&#39;true&#39;<\/span><span class=\"p\">)<\/span>\n<span class=\"w\">                                    <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">(((((<\/span><span class=\"ss\">&quot;__be_0_v_user_ref&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;isModerator&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"p\">((<\/span><span class=\"s1\">&#39;true&#39;<\/span><span class=\"p\">)::<\/span><span class=\"nb\">boolean<\/span><span class=\"p\">))<\/span>\n<span class=\"w\">                                    <\/span><span class=\"k\">OR<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"ss\">&quot;__be_0_v_user_ref&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;isModerator&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">IS<\/span><span class=\"w\"> <\/span><span class=\"k\">NULL<\/span><span class=\"p\">)<\/span>\n<span class=\"w\">                                    <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"s1\">&#39;true&#39;<\/span><span class=\"p\">)::<\/span><span class=\"nb\">boolean<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">IS<\/span><span class=\"w\"> <\/span><span class=\"k\">NULL<\/span><span class=\"p\">)))<\/span>\n<span class=\"w\">                                    <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;true&#39;<\/span><span class=\"p\">))<\/span>\n<span class=\"w\">                                    <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;true&#39;<\/span><span class=\"p\">))))))<\/span>\n<span class=\"w\">                            <\/span><span class=\"k\">OR<\/span><span class=\"w\"> <\/span><span class=\"p\">((((<\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_pres_page_cursor&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"ss\">&quot;__subs&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;result_vars&quot;<\/span><span class=\"o\">#&gt;&gt;<\/span><span class=\"nb\">ARRAY<\/span><span class=\"p\">[<\/span><span class=\"s1\">&#39;session&#39;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"s1\">&#39;x-hasura-cursornotlockedinmeeting&#39;<\/span><span class=\"p\">]))::<\/span><span class=\"nb\">varchar<\/span><span class=\"p\">))<\/span>\n<span class=\"w\">                            <\/span><span class=\"k\">OR<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_pres_page_cursor&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">IS<\/span><span class=\"w\"> <\/span><span class=\"k\">NULL<\/span><span class=\"p\">)<\/span>\n<span class=\"w\">                            <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">((((<\/span><span class=\"ss\">&quot;__subs&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;result_vars&quot;<\/span><span class=\"o\">#&gt;&gt;<\/span><span class=\"nb\">ARRAY<\/span><span class=\"p\">[<\/span><span class=\"s1\">&#39;session&#39;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"s1\">&#39;x-hasura-cursornotlockedinmeeting&#39;<\/span><span class=\"p\">]))::<\/span><span class=\"nb\">varchar<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">IS<\/span><span class=\"w\"> <\/span><span class=\"k\">NULL<\/span><span class=\"p\">)))<\/span>\n<span class=\"w\">                            <\/span><span class=\"k\">OR<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_pres_page_cursor&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"ss\">&quot;__subs&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;result_vars&quot;<\/span><span class=\"o\">#&gt;&gt;<\/span><span class=\"nb\">ARRAY<\/span><span class=\"p\">[<\/span><span class=\"s1\">&#39;session&#39;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"s1\">&#39;x-hasura-cursorlockeduserid&#39;<\/span><span class=\"p\">]))::<\/span><span class=\"nb\">varchar<\/span><span class=\"p\">))<\/span>\n<span class=\"w\">                            <\/span><span class=\"k\">OR<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_pres_page_cursor&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">IS<\/span><span class=\"w\"> <\/span><span class=\"k\">NULL<\/span><span class=\"p\">)<\/span>\n<span class=\"w\">                            <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">((((<\/span><span class=\"ss\">&quot;__subs&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;result_vars&quot;<\/span><span class=\"o\">#&gt;&gt;<\/span><span class=\"nb\">ARRAY<\/span><span class=\"p\">[<\/span><span class=\"s1\">&#39;session&#39;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"s1\">&#39;x-hasura-cursorlockeduserid&#39;<\/span><span class=\"p\">]))::<\/span><span class=\"nb\">varchar<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">IS<\/span><span class=\"w\"> <\/span><span class=\"k\">NULL<\/span><span class=\"p\">))))))<\/span>\n<span class=\"w\">                            <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">((<\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_pres_page_cursor&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;isCurrentPage&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"ss\">&quot;__subs&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;result_vars&quot;<\/span><span class=\"o\">#&gt;&gt;<\/span><span class=\"nb\">ARRAY<\/span><span class=\"p\">[<\/span><span class=\"s1\">&#39;synthetic&#39;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"s1\">&#39;0&#39;<\/span><span class=\"p\">]))::<\/span><span class=\"nb\">boolean<\/span><span class=\"p\">)))<\/span>\n<span class=\"w\">                        <\/span><span class=\"k\">ORDER<\/span><span class=\"w\"> <\/span><span class=\"k\">BY<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">ASC<\/span><span class=\"w\"> <\/span><span class=\"n\">NULLS<\/span><span class=\"w\"> <\/span><span class=\"k\">LAST<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_root.base&quot;<\/span>\n<span class=\"w\">                    <\/span><span class=\"k\">LEFT<\/span><span class=\"w\"> <\/span><span class=\"k\">OUTER<\/span><span class=\"w\"> <\/span><span class=\"k\">JOIN<\/span><span class=\"w\"> <\/span><span class=\"k\">LATERAL<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span>\n<span class=\"w\">                        <\/span><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"n\">row_to_json<\/span><span class=\"p\">((<\/span>\n<span class=\"w\">                            <\/span><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_e&quot;<\/span>\n<span class=\"w\">                            <\/span><span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span>\n<span class=\"w\">                                <\/span><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_root.or.user.base&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;name&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;name&quot;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_root.or.user.base&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;presenter&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;presenter&quot;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_root.or.user.base&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;role&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;role&quot;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"s1\">&#39;user_ref&#39;<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;__typename&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_e&quot;<\/span><span class=\"p\">))<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;user&quot;<\/span>\n<span class=\"w\">                                <\/span><span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span>\n<span class=\"w\">                                    <\/span><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"o\">*<\/span>\n<span class=\"w\">                                    <\/span><span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_user_ref&quot;<\/span>\n<span class=\"w\">                                    <\/span><span class=\"k\">WHERE<\/span><span class=\"w\"> <\/span><span class=\"p\">((((<\/span><span class=\"ss\">&quot;_root.base&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;userId&quot;<\/span><span class=\"p\">))<\/span>\n<span class=\"w\">                                        <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">((<\/span><span class=\"ss\">&quot;_root.base&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">)))<\/span>\n<span class=\"w\">                                        <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_user_ref&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"ss\">&quot;__subs&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;result_vars&quot;<\/span><span class=\"o\">#&gt;&gt;<\/span><span class=\"nb\">ARRAY<\/span><span class=\"p\">[<\/span><span class=\"s1\">&#39;session&#39;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"s1\">&#39;x-hasura-meetingid&#39;<\/span><span class=\"p\">]))::<\/span><span class=\"nb\">varchar<\/span><span class=\"p\">))<\/span>\n<span class=\"w\">                                        <\/span><span class=\"k\">OR<\/span><span class=\"w\"> <\/span><span class=\"p\">(((<\/span><span class=\"ss\">&quot;public&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;v_user_ref&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;meetingId&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">IS<\/span><span class=\"w\"> <\/span><span class=\"k\">NULL<\/span><span class=\"p\">)<\/span>\n<span class=\"w\">                                        <\/span><span class=\"k\">AND<\/span><span class=\"w\"> <\/span><span class=\"p\">((((<\/span><span class=\"ss\">&quot;__subs&quot;<\/span><span class=\"p\">.<\/span><span class=\"ss\">&quot;result_vars&quot;<\/span><span class=\"o\">#&gt;&gt;<\/span><span class=\"nb\">ARRAY<\/span><span class=\"p\">[<\/span><span class=\"s1\">&#39;session&#39;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"s1\">&#39;x-hasura-meetingid&#39;<\/span><span class=\"p\">]))::<\/span><span class=\"nb\">varchar<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">IS<\/span><span class=\"w\"> <\/span><span class=\"k\">NULL<\/span><span class=\"p\">))))<\/span>\n<span class=\"w\">                                    <\/span><span class=\"k\">LIMIT<\/span><span class=\"w\"> <\/span><span class=\"mi\">1<\/span><span class=\"p\">)<\/span>\n<span class=\"w\">                                <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_root.or.user.base&quot;<\/span><span class=\"p\">)<\/span>\n<span class=\"w\">                            <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_root.or.user&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">ON<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;true&#39;<\/span><span class=\"p\">)<\/span>\n<span class=\"w\">            <\/span><span class=\"k\">ORDER<\/span><span class=\"w\"> <\/span><span class=\"k\">BY<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;root.pg.userId&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">ASC<\/span><span class=\"w\"> <\/span><span class=\"n\">NULLS<\/span><span class=\"w\"> <\/span><span class=\"k\">LAST<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_root&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;_pres_page_cursor&quot;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"ss\">&quot;__fld_resp&quot;<\/span><span class=\"w\"> <\/span><span class=\"k\">ON<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;true&#39;<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div>\n\n<p>This <em>huge<\/em> query ist just for one type of subscription, and it is triggered once every 100ms to 250ms. Remember, this is for tracking mouse movement. Literally just two float values. There are many other types of state that clients subscribe to and I have seen much bigger queries flying by. On an empty server this may still be <em>okay<\/em>-ish since the actual database is tiny and most of it is cached in memory, but come on...<\/p>\n<p>Hasuka tries to optimize this to a limited degree. Multiple subscriptions to the same query can be merged into batches of 1000 and handled by a single larger SQL query. This is probably the reason this model works at all for multiple clients and does not melt the CPU on busy servers, but there are still multiple subscriptions that hammer the database every 100ms with huge queries. There must be a better way.<\/p>\n<p>How about a larger interval? Hasuka actually defaults to one poll per second. This would be fine for some types of state, but not for mouse movement or whiteboard changes. Those need to be quicker. But the interval can only be configured globally, not per query, so that's not an option. This alone should be an indicator that, maybe, piping real time mouse movement events though a relation database is not the best idea.<\/p>\n<h2 id=\"conclusion\">Conclusion<a class=\"headerlink\" href=\"#conclusion\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>We all know this already: <strong>Complexity is bad, more so if it hides below a layer of false simplicity. Choose the right tool for the job. There is no silver bullet.<\/strong> All this also applies here.<\/p>\n<p>At the same time, I understand why Hasura was chosen as a meteor replacement and I do not think it was a bad decision. It adds flexibility and simplifies development, two very important factors in a project like BigBlueButton. But it's also improtant to know and understand the price we pay for this flexibility and convenience, and regularly check if it's still worth it. <\/p>\n<p>Let's hope BBB can reduce the impact a little bit in future releases by moving to a more efficient pub\/sub and state model for high frequency data. A lot can be achieved by tweaking and optimizing the current approach, but only to a certain limit. The flexibility of GraphQL is also it's warkness. I can already see another re-write in a couple of years, maybe even earlier.<\/p>\n<!--\n## Alternatives?\n\nIt's easy to point out flaws in a dot-zero release that is not even released yet. Let's take a step back and think about how this *could* be solved in an imaginary future release.\n\nWhat about a model where there is a hand-crafted state server, backed by redis, that clients connect to via websocket. But instead of issuing arbitrary GraphQL queries, there are well defined *channels* each client can subscribe to. Channels represents a specific type of state, which is the result of a stream of *state change* events. Those are triggered by server-side business logic, not by clients directly. State that is local to a meeting or user context is represented by a *scoped channel* which only tracks and forwards a filtered subset of all events. Those scoped channels are volatile, they are created on demand and disappear as soon as the user disconnects or the meeting ends.\n\nThe server keeps track of the *current* state per channel and sends it to new clients as soon as they subscribe. From then on, the client is responsible for updating its own copy of the state by applying new state change events. Since both server and client need to know how to apply changes, those should follow some universal protocol that is not channel-specific. JSON-PATCH comes to mind, but it can be simpler if we do not allow arbitrary changes in deeply nested structures, but limit ourselves to SET\/UNSET of top-level keys in a hash, or INSERT\/REMOVE of items in an ordered list.\n\nThis sounds a lot like what meteor did in BBB 2.x, and that's no surprise. It is a very common model for synchronized state. The main performance benefit here would be that there is no disk-persisted database in the mix. We usually do not need to remember all changes, just the current state, and that should be is small enough to fit into memory. If we really need to keep track of all changes (e.g. for recording) then a server-side listener could subscribe to all relevant channels and write all changes to a file for post-processing.\n\nSo, how would this look like for mouse movements? The channel would be named `cursor` and scoped to a meeting. Clients can only subscribe if they are actually joined in that meeting, and they will be forcefully unsubscribed if they leave the meeting. This channel would track the cursor position with some metadata (e.g. `{x: float, y: float, name: str, color: str}`) and update events would only update what actually changed (e.g. `{\"$channel\": \"cursor\", \"$scope\": \"meeting5\", \"x\": 0.1337, \"y\": 0.4223}`).\n\n-->","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"BigBlueButton"}}]},{"title":"CVE-2024-52581 - litestar","link":{"@attributes":{"href":"https:\/\/defnull.de\/2024\/CVE-2024-52581_litestar\/","rel":"alternate"}},"published":"2024-11-17T00:00:00+01:00","updated":"2024-11-17T00:00:00+01:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2024-11-17:\/2024\/CVE-2024-52581_litestar\/","summary":"<p>A while ago I found <a href=\"https:\/\/www.cve.org\/CVERecord?id=CVE-2024-47874\">CVE-2024-47874<\/a> in <a href=\"https:\/\/starlette.dev\/\">starlette<\/a> (and <a href=\"https:\/\/fastapi.tiangolo.com\/\">FastAPI<\/a>). The same issue is also present in <a href=\"https:\/\/litestar.dev\/\">litestar<\/a> and I repotted that as <a href=\"https:\/\/github.com\/advisories\/GHSA-gjcc-jvgw-wvwj\">CVE-2024-52581<\/a> (CVSSv4 8.7). The reaction time from the team was very quick this time and a fix was published in less than a week. A new \u2026<\/p>","content":"<p>A while ago I found <a href=\"https:\/\/www.cve.org\/CVERecord?id=CVE-2024-47874\">CVE-2024-47874<\/a> in <a href=\"https:\/\/starlette.dev\/\">starlette<\/a> (and <a href=\"https:\/\/fastapi.tiangolo.com\/\">FastAPI<\/a>). The same issue is also present in <a href=\"https:\/\/litestar.dev\/\">litestar<\/a> and I repotted that as <a href=\"https:\/\/github.com\/advisories\/GHSA-gjcc-jvgw-wvwj\">CVE-2024-52581<\/a> (CVSSv4 8.7). The reaction time from the team was very quick this time and a fix was published in less than a week. A new record? I'm very happy with how this was handled.<\/p>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"Python"}},{"@attributes":{"term":"infosec"}},{"@attributes":{"term":"CVE"}}]},{"title":"CVE-2024-49767 - Werkzeug \/ Flask \/ Quart","link":{"@attributes":{"href":"https:\/\/defnull.de\/2024\/CVE-2024-49767_flask\/","rel":"alternate"}},"published":"2024-10-25T00:00:00+02:00","updated":"2024-10-25T00:00:00+02:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2024-10-25:\/2024\/CVE-2024-49767_flask\/","summary":"<p><a href=\"https:\/\/werkzeug.palletsprojects.com\/\">Werkzeug<\/a> is a Web Server Gateway Interface (WSGI) library used to develop python web applications or frameworks. Applications using <code>werkzeug.formparser.MultiPartParser<\/code> to parse <code>multipart\/form-data<\/code> requests (e.g. all <a href=\"https:\/\/flask.palletsprojects.com\/\">flask<\/a> and <a href=\"https:\/\/quart.palletsprojects.com\">quart<\/a> applications) were vulnerable to resource exhaustion (denial of service) attacks. A specifically crafted form submission request could \u2026<\/p>","content":"<p><a href=\"https:\/\/werkzeug.palletsprojects.com\/\">Werkzeug<\/a> is a Web Server Gateway Interface (WSGI) library used to develop python web applications or frameworks. Applications using <code>werkzeug.formparser.MultiPartParser<\/code> to parse <code>multipart\/form-data<\/code> requests (e.g. all <a href=\"https:\/\/flask.palletsprojects.com\/\">flask<\/a> and <a href=\"https:\/\/quart.palletsprojects.com\">quart<\/a> applications) were vulnerable to resource exhaustion (denial of service) attacks. A specifically crafted form submission request could cause the parser to allocate and block 3 to 8 times the upload size in main memory. There was no upper limit; a single upload at 1 Gbit\/s could exhaust 32 GB of RAM in less than 60 seconds.<\/p>\n<ul>\n<li><a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2024-49767\">CVE-2024-49767<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/pallets\/werkzeug\/security\/advisories\/GHSA-q34m-jh98-gwm2\">GHSA-q34m-jh98-gwm2<\/a><\/li>\n<li>CVSSv4: 6.9 (<code>CVSS:4.0\/AV:N\/AC:L\/AT:N\/PR:N\/UI:N\/VC:N\/VI:N\/VA:L\/SC:N\/SI:N\/SA:N<\/code>)<\/li>\n<\/ul>\n<div class=\"toc\"><span class=\"toctitle\">Table of contents:<\/span><ul>\n<li><a href=\"#original-report\">Original Report<\/a><\/li>\n<li><a href=\"#timeline\">Timeline<\/a><\/li>\n<li><a href=\"#lessons-learned\">Lessons learned<\/a><\/li>\n<\/ul>\n<\/div>\n<h2 id=\"original-report\">Original Report<a class=\"headerlink\" href=\"#original-report\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p><strong>Note: The final report published by the maintainers was heavily edited and lacked essential details, which is why I decided publish the original report here.<\/strong><\/p>\n<p>The multipart parser implementation found in <code>werkzeug.formparser<\/code> distinguishes between file uploads and text fields by looking for a <code>filename<\/code> option in the <code>Content-Disposition<\/code> multipart segment header. If present, the multipart segment is treated as file uploads and buffered into a <code>SpooledTemporaryFile<\/code>. If the filename option is missing, the segment is treated as a text field and buffered into an in-memory list instead. This list is allowed to grow indefinitely. Once complete, the buffered chunks are concatenated and decoded which causes a peak memory consumption of 3 to 8 times the original uncompressed upload size. With clever use of specific unicode glyphs this factor can probably be increased even further.<\/p>\n<p>This allows an attacker to craft <code>multipart\/form-data<\/code> requests that completely exhaust the servers main memory, causing excessive swapping or out-of-memory situations. A 32GB server can be exhausted over a 1 Gbit\/s line in less than a minute, with just a single request. <code>Transfer-Encoding: chunked<\/code> can be used to bypass early safeguards that rely on a <code>Content-Length<\/code> header. Sending data slowly over several requests in parallel should avoid timeouts but still block huge amounts of memory for a long time before individual requests or the entire server process is eventually killed by the kernels OOM killer.<\/p>\n<p>Other multipart libraries or web frameworks have configurable limits for in-memory (and on-disk) data structures and will either error out if header sections or text fields grow larger than allowed, or treat those large text fields as file uploads (with an empty filename) and buffer to disk as a safeguard. In werkzeug there is no limit for on-disk buffering and the <code>max_form_memory_size<\/code> limit is only enforced on the header section of a multipart segment, but ignored for the in-memory list used to buffer text fields. The <code>max_content_length<\/code> limit on the other hand is too strict, as it would also limit regular file uploads. \nBoth limits are not set in Werkzeug, Flask or Quart by default, leaving applications vulnerable to this attack by default.<\/p>\n<p><strong>Proof of concept<\/strong><\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"kn\">import<\/span><span class=\"w\"> <\/span><span class=\"nn\">flask<\/span>\n<span class=\"n\">app<\/span> <span class=\"o\">=<\/span> <span class=\"n\">flask<\/span><span class=\"o\">.<\/span><span class=\"n\">Flask<\/span><span class=\"p\">(<\/span><span class=\"vm\">__name__<\/span><span class=\"p\">)<\/span>\n<span class=\"nd\">@app<\/span><span class=\"o\">.<\/span><span class=\"n\">post<\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;\/&#39;<\/span><span class=\"p\">)<\/span>\n<span class=\"k\">def<\/span><span class=\"w\"> <\/span><span class=\"nf\">foo<\/span><span class=\"p\">():<\/span>\n    <span class=\"n\">flask<\/span><span class=\"o\">.<\/span><span class=\"n\">request<\/span><span class=\"o\">.<\/span><span class=\"n\">form<\/span>\n    <span class=\"k\">return<\/span> <span class=\"s1\">&#39;DONE&#39;<\/span>\n<\/code><\/pre><\/div>\n\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"kn\">from<\/span><span class=\"w\"> <\/span><span class=\"nn\">quart<\/span><span class=\"w\"> <\/span><span class=\"kn\">import<\/span> <span class=\"n\">Quart<\/span><span class=\"p\">,<\/span> <span class=\"n\">request<\/span>\n<span class=\"n\">app<\/span> <span class=\"o\">=<\/span> <span class=\"n\">Quart<\/span><span class=\"p\">(<\/span><span class=\"vm\">__name__<\/span><span class=\"p\">)<\/span>\n\n<span class=\"nd\">@app<\/span><span class=\"o\">.<\/span><span class=\"n\">route<\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;\/&#39;<\/span><span class=\"p\">,<\/span> <span class=\"n\">methods<\/span><span class=\"o\">=<\/span><span class=\"p\">[<\/span><span class=\"s2\">&quot;POST&quot;<\/span><span class=\"p\">])<\/span>\n<span class=\"k\">async<\/span> <span class=\"k\">def<\/span><span class=\"w\"> <\/span><span class=\"nf\">greet<\/span><span class=\"p\">():<\/span>\n    <span class=\"k\">await<\/span> <span class=\"n\">request<\/span><span class=\"o\">.<\/span><span class=\"n\">form<\/span>\n    <span class=\"k\">return<\/span> <span class=\"s1\">&#39;DONE&#39;<\/span>\n\n<span class=\"n\">app<\/span><span class=\"o\">.<\/span><span class=\"n\">run<\/span><span class=\"p\">()<\/span>\n<\/code><\/pre><\/div>\n\n<div class=\"highlight\"><pre><span><\/span><code>$<span class=\"w\"> <\/span>curl<span class=\"w\"> <\/span>http:\/\/localhost:5000<span class=\"w\"> <\/span>-F<span class=\"w\"> <\/span><span class=\"s1\">&#39;big=&lt;\/dev\/urandom&#39;<\/span>\n<span class=\"c1\"># WARNING: This will fill up memory and start swapping almost instantly. Use --limit-rate 1M for a slow death<\/span>\n<\/code><\/pre><\/div>\n\n<p><strong>Impact<\/strong><\/p>\n<p>Vulnerable are all applications that use <code>werkzeug.formparser.MultiPartParser<\/code> to parse <code>multipart\/form-data<\/code> requests (e.g. all flask and quart applications) and expose an endpoint that processes form submissions. Those applications can be crashed or slowed down by exhausting system memory, possibly also affecting other services running on the same system (e.g. database servers).<\/p>\n<p><strong>Mitigation<\/strong><\/p>\n<p>Limit maximum upload size in the WSGI\/ASGI server or proxy in front of the vulnerable application to a value that would fits into available memory twice per worker thread.<\/p>\n<h2 id=\"timeline\">Timeline<a class=\"headerlink\" href=\"#timeline\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p><strong>03.09.2024 (+0 days)<\/strong> First contact. Sent a detailed report (similar to the one above) to the projects security contact email.<\/p>\n<p><strong>10.09.2024 (+7 days)<\/strong> No response. Contacted their security email again and asked for confirmation. Got a quick response this time. They asked to open a GitHub security advisory, <a href=\"https:\/\/github.com\/pallets\/werkzeug\/security\/advisories\/GHSA-q34m-jh98-gwm2\">which I did<\/a>. Note that the published CVE and GHSA text is <em>not<\/em> the original report.<\/p>\n<p><strong>02.10.2024 (+29 days)<\/strong> No response for three weeks, so asked again for an estimate. The responsible maintainer suggested that I should provide a patch, mentioned two config setting which were already mentioned in the initial report as known to be ineffective or unsuitable, then continued to argue that insecure defaults or resource exhaustion should not count as a <em>security<\/em> issue in the first place. A bit of back and forth followed, mostly about the impact and severity of the issue. They then tried to reproduce the issue with <code>max_content_length = 1000<\/code>, a value so low that it would also reject most legitimate requests. This also triggered an unrelated logic bug and broke <em>all<\/em> form submissions, even smaller ones. The provided PoC, which uses default values for those settings and worked as expected, was ignored.<\/p>\n<p><strong>10.10.2024 (+37 days)<\/strong> Mentioned that Starlette had <a href=\"https:\/\/github.com\/encode\/starlette\/security\/advisories\/GHSA-f96h-pmfr-66vw\">a very similar issue<\/a> and already released a fix. The details are now public and easily transferable to werkzeug. No response from the maintainer.<\/p>\n<p><strong>25.10.2024 (+52 days)<\/strong> The same maintainer tried again to reproduce the issue, failed for the exact same reason that was already discussed 3 weeks ago, and closed the report without waiting for feedback. Explained (again) why a limit below 64k breaks <em>all<\/em> form submissions, not only malicious ones, and how to properly reproduce the issue. No response.<\/p>\n<p><strong>25.10.2024 (+52 days)<\/strong> Reached out on their the public developer discord and asked for a second opinion, of cause without disclosing any details. A couple of hours later, the same maintainer deleted the public discord thread, accepted and published the report with a heavily edited description, pushed an incomplete fix and triggered a security patch release for werkzeug. All this happened within a couple of hours without asking for feedback or waiting for confirmation. The fix partly repaired the ineffective <code>max_content_length<\/code> parameter, but did not change the insecure defaults. The new report text lacked important details and downplayed the impact. It was published under my name without my consent.<\/p>\n<p><strong>27.10.2024 (+54 days)<\/strong> Opened a <a href=\"https:\/\/github.com\/pallets\/flask\/issues\/5622\">public issue<\/a> mentioning that all Flask and Quart (or other Werkzeug) applications are still vulnerable <em>by default<\/em>, and suggesting to introduce reasonable defaults for critical config settings. This was marked with the label <code>docs<\/code> instead of <code>security<\/code>. <\/p>\n<p><strong>31.10.2024 (+58 days)<\/strong> Werkzeug 3.1.0 was released with secure defaults.<\/p>\n<p><strong>01.10.2024 (+59 days)<\/strong> Noticed and reported that the fix for quart (0.19.7) was not effective.<\/p>\n<p><strong>23.12.2024 (+111 days)<\/strong> Quart was finally fixed, but the report was closed instead of published and no CVE was issued. The original CVE has not been updated either and still contains inaccurate ranges for affected versions.<\/p>\n<h2 id=\"lessons-learned\">Lessons learned<a class=\"headerlink\" href=\"#lessons-learned\" title=\"Permanent link\">&para;<\/a><\/h2>\n<p>Communication during this incident left a lot to be desired and the timeline speaks for itself. I will continue reporting issues to <a href=\"https:\/\/palletsprojects.com\/\">Pallets<\/a> projects responsibly of cause, but no longer spend time arguing with maintainers who clearly do not want to deal with those issues. Next time there will be a single report on a neutral platform (i.e., not GHSA) and a reasonable deadline.<\/p>\n<!--\n\n# Original report to Quart\n\n## Summary\n\nQuart 0.19.7 claims to include a fix for [CVE-2024-49767](https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2024-49767) ([GHSA-q34m-jh98-gwm2](https:\/\/github.com\/advisories\/GHSA-q34m-jh98-gwm2)) but the fix is not effective. It is still possible to upload arbitrary large `multipart\/form-data` text fields into memory.\n\n## Details\nThe quart version of `FormDataParser` has a `max_form_memory_size` parameter and `quart>=0.19.7` no longer fails to enforce this limit, but that was not sufficient to prevent the attack described in the original report. The parameter is `None` (no limit) by default and there is no way to change its value from user code. `Request.make_form_parser()` instantiates `FormDataParser` without this parameter. This differs from werkzeug where the `Request` class has a `max_form_memory_size` class attribute which is passed down to the form parser. Quart does not have this config option and no documented way to configure this limit. \n\n## PoC\nVery similar to what was originally reported in [GHSA-q34m-jh98-gwm2](https:\/\/github.com\/advisories\/GHSA-q34m-jh98-gwm2), but the PoC got removed from the text prior to publication.\n\n\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"kn\">from<\/span><span class=\"w\"> <\/span><span class=\"nn\">quart<\/span><span class=\"w\"> <\/span><span class=\"kn\">import<\/span> <span class=\"n\">Quart<\/span><span class=\"p\">,<\/span> <span class=\"n\">request<\/span>\n<span class=\"n\">app<\/span> <span class=\"o\">=<\/span> <span class=\"n\">Quart<\/span><span class=\"p\">(<\/span><span class=\"vm\">__name__<\/span><span class=\"p\">)<\/span>\n\n<span class=\"nd\">@app<\/span><span class=\"o\">.<\/span><span class=\"n\">route<\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;\/&#39;<\/span><span class=\"p\">,<\/span> <span class=\"n\">methods<\/span><span class=\"o\">=<\/span><span class=\"p\">[<\/span><span class=\"s2\">&quot;POST&quot;<\/span><span class=\"p\">])<\/span>\n<span class=\"k\">async<\/span> <span class=\"k\">def<\/span><span class=\"w\"> <\/span><span class=\"nf\">greet<\/span><span class=\"p\">():<\/span>\n    <span class=\"k\">await<\/span> <span class=\"n\">request<\/span><span class=\"o\">.<\/span><span class=\"n\">form<\/span>\n    <span class=\"k\">return<\/span> <span class=\"s1\">&#39;Hello, World!&#39;<\/span>\n\n<span class=\"n\">app<\/span><span class=\"o\">.<\/span><span class=\"n\">run<\/span><span class=\"p\">()<\/span>\n<\/code><\/pre><\/div>\n\n\n\n\n<div class=\"highlight\"><pre><span><\/span><code>$<span class=\"w\"> <\/span>curl<span class=\"w\"> <\/span>http:\/\/localhost:5000<span class=\"w\"> <\/span>-F<span class=\"w\"> <\/span><span class=\"s1\">&#39;big=&lt;\/dev\/urandom&#39;<\/span>\n<span class=\"c1\"># WARNING: This will fill up memory and start swapping almost instantly. Use --limit-rate 1M for a slow death<\/span>\n<\/code><\/pre><\/div>\n\n\n\n-->","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"Python"}},{"@attributes":{"term":"infosec"}},{"@attributes":{"term":"CVE"}}]},{"title":"CVE-2024-47874 - Starlette\/FastAPI","link":{"@attributes":{"href":"https:\/\/defnull.de\/2024\/CVE-2024-47874_starlette\/","rel":"alternate"}},"published":"2024-10-15T00:00:00+02:00","updated":"2024-10-15T00:00:00+02:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2024-10-15:\/2024\/CVE-2024-47874_starlette\/","summary":"<p>I'm finally allowed to speak about this nice little DoS vulnerability I found in <a href=\"https:\/\/starlette.dev\/\">starlette<\/a> (and <a href=\"https:\/\/fastapi.tiangolo.com\/\">FastAPI<\/a>). <\/p>\n<ul>\n<li>CVE <a href=\"https:\/\/www.cve.org\/CVERecord?id=CVE-2024-47874\">https:\/\/www.cve.org\/CVERecord?id=CVE-2024-47874<\/a>  <\/li>\n<li>GHSA <a href=\"https:\/\/github.com\/encode\/starlette\/security\/advisories\/GHSA-f96h-pmfr-66vw\">https:\/\/github.com\/encode\/starlette\/security\/advisories\/GHSA-f96h-pmfr-66vw<\/a><\/li>\n<\/ul>\n<p>The FastAPI devs <a href=\"https:\/\/github.com\/fastapi\/fastapi\/pull\/12431\">published<\/a> an update 3 days before the security release of Starlette that widened \u2026<\/p>","content":"<p>I'm finally allowed to speak about this nice little DoS vulnerability I found in <a href=\"https:\/\/starlette.dev\/\">starlette<\/a> (and <a href=\"https:\/\/fastapi.tiangolo.com\/\">FastAPI<\/a>). <\/p>\n<ul>\n<li>CVE <a href=\"https:\/\/www.cve.org\/CVERecord?id=CVE-2024-47874\">https:\/\/www.cve.org\/CVERecord?id=CVE-2024-47874<\/a>  <\/li>\n<li>GHSA <a href=\"https:\/\/github.com\/encode\/starlette\/security\/advisories\/GHSA-f96h-pmfr-66vw\">https:\/\/github.com\/encode\/starlette\/security\/advisories\/GHSA-f96h-pmfr-66vw<\/a><\/li>\n<\/ul>\n<p>The FastAPI devs <a href=\"https:\/\/github.com\/fastapi\/fastapi\/pull\/12431\">published<\/a> an update 3 days before the security release of Starlette that widened the version range of the dependency just enough to allow the to-be-released patch. Sneaky!<\/p>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"Python"}},{"@attributes":{"term":"infosec"}},{"@attributes":{"term":"CVE"}}]},{"title":"Password leaks are 90% fake","link":{"@attributes":{"href":"https:\/\/defnull.de\/2024\/fake-password-leaks\/","rel":"alternate"}},"published":"2024-02-03T00:00:00+01:00","updated":"2024-02-03T00:00:00+01:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2024-02-03:\/2024\/fake-password-leaks\/","summary":"<p>Digging through the most popular password 'leak' compilations for a <a href=\"https:\/\/pwcheck.gwdg.de\/\">side project<\/a> and it's &gt;90% fake.<\/p>\n<p>Only a tiny fraction of those passwords may have been used by a human at some point, the rest is computer-generated junk. Even the real passwords are probably stolen from other leaks.<\/p>\n<p>The reason \u2026<\/p>","content":"<p>Digging through the most popular password 'leak' compilations for a <a href=\"https:\/\/pwcheck.gwdg.de\/\">side project<\/a> and it's &gt;90% fake.<\/p>\n<p>Only a tiny fraction of those passwords may have been used by a human at some point, the rest is computer-generated junk. Even the real passwords are probably stolen from other leaks.<\/p>\n<p>The reason is obvious: No honor among thieves. Salted hashes are worthless, cracking hardware is expensive, so they simply hallucinate some passwords and sell it as a fully cracked credentials leak.<\/p>\n<p>Someone buys a faked or artificially inflated leak, finds out that none of those credentials work, and burns it (makes it public). No one would waste a credentials database that is actually working, so only the junk ends up in those free and popular compilations. The bigger ones contain more 'passwords' than there are people on the planet. The bigger the better, apparently.<\/p>\n<p>And the security industry\/media? Fearmongering and hyping the 'largest leak ever' as usual.<\/p>\n<p>Fun fact: Sorting a password list before compression reduces its size from 4.9GB to less than 1.3GB. Same compression parameters, just sorted vs. unsorted. But 4.9GB sounds more important than 1.3GB and in a sorted list you can easily see the patterns of the computer-generated fake passwords, so why would a seller do that?<\/p>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"infosec"}}]},{"title":"Introducing Fediwall","link":{"@attributes":{"href":"https:\/\/defnull.de\/2023\/fediwall\/","rel":"alternate"}},"published":"2023-07-15T00:00:00+02:00","updated":"2023-07-15T00:00:00+02:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2023-07-15:\/2023\/fediwall\/","summary":"<p>I did a thing! <a href=\"https:\/\/fediwall.social\/\">Fediwall<\/a> is a configurable social media wall for the fediverse, similar to all the Twitter walls that no longer work. It's <a href=\"https:\/\/github.com\/defnull\/fediwall\">opensource<\/a> and easy to self-host if you want, but you can also use the public instance on <a href=\"https:\/\/fediwall.social\/\">https:\/\/fediwall.social\/<\/a> and configure it yourself. Click \u2026<\/p>","content":"<p>I did a thing! <a href=\"https:\/\/fediwall.social\/\">Fediwall<\/a> is a configurable social media wall for the fediverse, similar to all the Twitter walls that no longer work. It's <a href=\"https:\/\/github.com\/defnull\/fediwall\">opensource<\/a> and easy to self-host if you want, but you can also use the public instance on <a href=\"https:\/\/fediwall.social\/\">https:\/\/fediwall.social\/<\/a> and configure it yourself. Click the info bar at the top, configure it however you like and then bookmark or share the URL.<\/p>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"Mastodon"}},{"@attributes":{"term":"Fediverse"}},{"@attributes":{"term":"FOSS"}},{"@attributes":{"term":"Fediwall"}}]},{"title":"404 Blog not found","link":{"@attributes":{"href":"https:\/\/defnull.de\/2021\/not-a-blog\/","rel":"alternate"}},"published":"2021-01-11T00:00:00+01:00","updated":"2026-07-09T00:00:00+02:00","author":{"name":"Marcel Hellkamp"},"id":"tag:defnull.de,2021-01-11:\/2021\/not-a-blog\/","content":"<p><strong>This website was created mostly because t-online tends to block e-mails from mail servers that do not have a website and contact information attached. <del title=\"edit: This is an actual blog now\">I probably won't post articles here.<\/del> The <a href=\"{filename}\/pages\/10-about.md\">About Me<\/a> page is populated if you want to know more.<\/strong><\/p>","category":[{"@attributes":{"term":"misc"}},{"@attributes":{"term":"meta"}}]}]}