{"@attributes":{"version":"2.0"},"channel":{"title":"Hex","link":"https:\/\/0x484558.dev","description":"Blog posts by Hex, covering Rust, emerging web standards like WebAssembly, cybersecurity and other technology topics.","generator":"Zola","language":"en","lastBuildDate":"Sun, 12 Apr 2026 00:00:00 +0000","item":[{"title":"The Genius of Portal 2 Soundtrack","pubDate":"Sun, 12 Apr 2026 00:00:00 +0000","author":"Hex","link":"https:\/\/0x484558.dev\/blog\/portal2-music\/","guid":"https:\/\/0x484558.dev\/blog\/portal2-music\/","description":"<p>Most video game soundtracks accompany a story. But in Portal 2, the music takes the stage: it <em>is<\/em> the story. In this article, I will break down the score of Portal 2 as a pinnacle of theatric symphonic procession. I will not be going deep into musical chords and their progression; this article is written up to date with the modern approach to music where harmony transcends 12-tone notation, but the <em>structure<\/em> remains relevant.<\/p>\n<p>Beneath the industrial hums, mangled chiptunes, and the ironic pop closure, lies a monumental work of staggering formal sophistication: a symphonic suite, an opera that unfolds across 3 discs representing 3 acts of a whole, governed by leitmotifs as rigorously developed as anything in Wagner or Beethoven, yet rendered entirely in the language of machines.<\/p>\n<p>Mike Morasky, the composer behind pseudonym Aperture Science Psychoacoustic Laboratories that Valve used for publishing the official soundtrack, constructed a sonata-form tragedy in which the protagonist is not Chell, but the facility itself; a decaying orchestra of steel and silicon, trapping human orchestral sound inside of its electric hubris, which then re-emerges as victorious in the grand finale. <em>Or does it?<\/em><\/p>\n<h2 id=\"portal-2-as-an-opera\">Portal 2 as an Opera<\/h2>\n<p>Sonata-Allegro form is a structural logic that governed Western music since the mid-18th century, which represents a blueprint by which <a rel=\"noopener nofollow noreferrer external\" target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/Program_music\">programmatic music<\/a> is built. It is pretty intuitive, and divided into three phases:<\/p>\n<ol>\n<li><strong>Exposition:<\/strong> in the opening, the composer usually presents two primary themes and establishes the context of the conflict that is about to be presented. <del>Because, of course, conflicts are all western music is about.<\/del><\/li>\n<li><strong>Development:<\/strong> the composer takes themes presented in the exposition and breaks them, fragments them, transposes, modulates, collides against one another, and stretches to their breaking point.<\/li>\n<li><strong>Recapitulation:<\/strong> the final part usually returns to themes from exposition, and formally, played in home key. This phase usually ends with a <em>coda<\/em> (literally the \u201ctail\u201d) that reinforces the resolution, or offers one last look at a theme in most triumphant or tragic form.<\/li>\n<\/ol>\n<p><img src=\"https:\/\/0x484558.dev\/blog\/portal2-music\/sonata-form.png\" alt=\"Sonata Form\" \/><\/p>\n<p>This is the skeleton to the structure of programmatic music, and Portal 2 leans heavily on this classical formula. Although modern music writing tends to neglect properness in this respect - and to a fault, because neglecting it results in un-memorable soundtracks - it is possible to discover that still a lot of soundtracks to some degree follow this formula. Because it <em>kind of makes intuitive sense,<\/em> if you are trying to tell an emotional story through music, you are very likely to inadvertently fall within this cycle.<\/p>\n<p>However, Portal 2 is not a single movement of a symphony, but an entire grand opera. And it totally does not just pretend to be one:<\/p>\n<ul>\n<li><em>GLaDOS is prima donna, soprano.<\/em> She commands the stage and has her own lamenting aria.<\/li>\n<li>Wheatley is basso buffo, the clumsy comic villain.<\/li>\n<li>Cave Johnson is the ghostly baritone, as his presence is felt throughout the narrative.<\/li>\n<\/ul>\n<p>The entire cycle of 3 discs of Portal 2 soundtrack, as they were published by Valve, creates a coherent 3-act macro-form that starts with an overture and ends with a grand chorus, preserves leitmotifs (musical themes) and features literal arias. The soundtrack, therefore, is a grandiose experiment on the classical westerm form.<\/p>\n<p>I will comment on most of its tracks and hopefully show how this opera tells us story that, being closely dictated by <em>libretto<\/em>, the script, is not just accompanying the picture, but makes it work in the first place.<\/p>\n<h2 id=\"act-1-l-antefatto\">Act 1: L\u2019Antefatto<\/h2>\n<p>The first disc, which is the first major act in the soundtrack, starts with an overture that is a triptych of introductions:<\/p>\n<ol>\n<li>A heroic ostinato <em>\u201cScience is Fun\u201d<\/em> that establishes cold, synthetic, calculated momentum of the Aperture facility, and introduces a proleptic thematic statement, a spoiler: the adagio of <em>\u201cYour Precious Moon\u201d<\/em> embedded in its second half, whose tragic meaning is only realized at the very end of the entire cycle.<\/li>\n<li><em>\u201cConcentration Enhancing Menu Initializer\u201d<\/em> which provides a reused textural bridge that presents us with the reality of a decaying, malfunctioning complex. It is also a secondary menu theme that hovers in a harmonic vacuum, acts as a palate cleanser and tonal modulation for the second thematic statement of the overture.<\/li>\n<li>The track <em>\u201c9999999\u201d<\/em> which is also the initial main menu when the game is launched for the first time. It presents us with a majestic leitmotif familiar from later <em>\u201cMusic of the Spheres\u201d<\/em>, although the actual track appears only in the second disc: the overarching anthem of Aperture Science\u2019s hubris, violently mangled, struggling to survive beneath a suffocating blanket of erratic flitching of a synthesizer.<\/li>\n<\/ol>\n<p><em>\u201cScience is Fun\u201d<\/em> is a book example of the overture. It is also quite loud for being the first drop: that is precisely the job of the overture, to silence the audience and introduce the main leitmotif. Morasky honors this tradition brilliantly, granting us a prophetic glimpse of the finale\u2019s catharsis before the curtain has even truly rise, setting course for a cyclical destiny. He then introduces the second major leitmotif, which is exactly what a classical exposition demands. Now, we have two primary themes, and they will determine the entire conflict.<\/p>\n<h3 id=\"the-awakening\">The Awakening<\/h3>\n<p>The fourth track pivots from abstract exposition to narrative development with <em>\u201cThe Courtesy Call\u201d<\/em>, a suite-like awakening of the protagonist in a stasis chamber that immediately transitions into violent episode with Wheatley. Heavy, metallic synth-brass stabs begin to blare out, followed by arpeggio representing the colossal, indifferent scale of Aperture\u2019s machinery. Morasky scores the physical destruction of the room, flawlessly translating physical comedy and sheer terror into the language of industrial electronica. Rising from the debris, it also returns a hauntingly isolated miniature statement of the \u201cYour Precious Moon\u201d leitmotif, reinforcing the inevitability of the narrative through structural foreshadowing.<\/p>\n<p>The next two tracks in the disc are an environmental exposition. <em>\u201cTechnical Difficulties\u201d<\/em> and <em>\u201cOvergrowth\u201d<\/em> are the textural scene-setting of a decaying stage upon which the first act will play out. The grandeur of Aperture Science is completely stripped out and all we hear is severe digital aphasia, followed by harsh, broken minimalism juxtaposed by the eerie atmospheric swell. The music itself is damp, cavernous, and claustrophobic. <em>Beware of the ghosts!<\/em><\/p>\n<p>As Chell makes her way through the complex, we do indeed find messages from a literal ghost. With <em>\u201cGhost of Rattman\u201d<\/em> the ambience cracks to reveal bleeding of schizophrenic human element trapped within its walls. It is a terrifying avant-garde realm of <em>musique concr\u00e8te<\/em>. It tries to defy the orchestration of the primary theme but its true horror is that the track is fundamentally subjugated to it: peeling it back, the backbone of <em>\u201cGhost of Rattman\u201d<\/em> is not arrhythmic at all, but at its structural core has \u201cReconstructing Science\u201d leitmotif, before it is even formally introduced. Ultimately, it forces the very terror to keep time with the facility\u2019s metronome. The track fades into an accoustic bridge of <em>\u201cHaunted Panels\u201d<\/em> pizzicato.<\/p>\n<p>The tentative, creeping tension is abruptly swept away by chilling electric harmony of <em>\u201cThe Future Starts With You\u201d<\/em>, which augments haunting ambience with massive octaves, moving with deliberate, glacial gravity. The jingle in the track\u2019s core in its form could be associated with slickness of Aperture, but its substance sounds more like a tomb. Except, <em>it is not protagonist\u2019s tomb.<\/em><\/p>\n<p>And <em>\u201cThere She Is\u201d<\/em>. The breathtaking, eerie stillness of the track succeeds the claustrophobic ambience, which subverts the expectation. Rather than mounting horror further, it strikes with calm, profoundly melancholic melody. Mournful, delicate, accompanied by background choir - humanity trapped within GLaDOS. It is, nonetheless, a trap for intents of our tragedy, shattered by apocalyptic grandeur of <em>\u201cYou Know Her?\u201d<\/em> when Wheatley and Chell open the Pandora\u2019s box, which culminates in a percussive march as the antagonist awakens. The queen is back on her throne, the board is set, and the suite transitions into relentless, algorithmic development section.<\/p>\n<p>What follows next is a set of tracks that remind us of so-called Intelligent Dance Music (IDM) and resemble fundamentalists of the subgenre like Autechre. Nonetheless, they are not an exclusion from our opera form - they represent <em>recitative<\/em>, the primary plot mover for this act.<\/p>\n<h3 id=\"the-testing\">The Testing<\/h3>\n<p>The human orchestra is entirely replaced by intense fragmentations, modulations, and harmonic tensions, and the music is intrinsically designed to be tied to player\u2019s physical location and momentum. As Chell interacts with the environment, new rhythmic stems, synthesized arpeggios, and percussive layers are dynamically injected into the mix. This is not just a dance to the machine\u2019s music, the machine is forcing the protagonist to <em>compose<\/em> it, but only according to its own rigid inescapable tempo. The human element is completely subsumed by the grid. Although all tracks of this sections are kind of boppers, unique and catchy.<\/p>\n<p>The twelveth track of the disc, <em>\u201cThe Friendly Faith Plate\u201d<\/em>, is a staccato scherzo that kicks off this sequence. In classic form, a scherzo is traditionally a light, fast-moving, and playful movement. Here, it is dripping with synthetic, calculated malice. Rapid, bouncy, tightly quantized electronic sound perfectly mimics the physical mechanism of the catapults, and the schizophrenic clash of synthetic joy and dizzying fight for survival.<\/p>\n<blockquote>\n<p><em>\u201cLook at you. Sailing through the air majestically. Like an eagle. Piloting a blimp.\u201d<\/em> - GLaDOS<\/p>\n<\/blockquote>\n<p>Next track completely inverts its predecessor. <em>\u201c15 Acros of Broken Glass\u201d<\/em> consists primarily of menacing sub-bass pulse, heavily textured with the rhythmic metallic scraping and drowning grinding lead, radiating pure electrical dread. This track is also important structurall and still stays in line with common classical patterns, except involves no orchestra at all - it plunges into what could otherwise be the lower strings and heavy brass section that builds subterranean tension before a major thematic shift, which comes in fourteenth track: <em>\u201cLove as a Construct\u201d<\/em>.<\/p>\n<p>Bouncy body changes in <em>\u201cLove as a Construct\u201d<\/em> that is the <em>aria<\/em> in this section associated with Chell. Except, naturally, Chell has no voice, so instead we get a low-tempo glitching intermezzo that no longer presents a palpable physical threat, but a more insidious weapon: psychological warfare. The track encodes <em>\u201cCara Mia Addio\u201d<\/em>, the song of turrets from the very ending of the game, but this might as well be the apex of toxicity that GLaDOS exhibits throughout the testing so far: her facility is not just an orchestra of steel, but a panopticon, in which human soul itself is trapped and the jailer continuously hurls highly personal insults regarding Chell\u2019s weight, intelligence, and her status as an unloved orphan. The music becomes weaponized through its own cheerful indifference that refuses to validate the suffering. Morasky denies the player this emotional catharsis. This is followed by fifteenth track <em>\u201cI Saw a Deer Today\u201d<\/em> which returns to bouncy yet acoustically unstable character with its generative rhythm, but the synthesizers are heavily, almost nauseatingly detuned - there might as well be only hopeless madness down there.<\/p>\n<p>Sixteenth track is a absolute standout, and it is in my opinion a uniquely beautiful track. <em>\u201cHard Sunshine\u201d<\/em> has blinding, incandescent force. Morasky has a Johannes Kepler\u2019s <em>Harmonice Mundi<\/em> moment here: this track achieves a total synthesis of visual, mechanical, and acoustic modalities, because the track itself creates a beautiful grid-like <a rel=\"noopener nofollow noreferrer external\" target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/Lissajous_curve\">Lissajous pattern<\/a> on oscilloscope. The music is most powerful when standing beneath the hard light bridge in the game.<\/p>\n<p><img src=\"https:\/\/0x484558.dev\/blog\/portal2-music\/hard-sunshine.png\" alt=\"2D oscilloscope image for Hard Sunshine\" \/><\/p>\n<blockquote>\n<p><em>\u201cIt would also set your hair on fire, so don\u2019t actually do it.\u201d<\/em> - GLaDOS<\/p>\n<\/blockquote>\n<p>It is the sound of an omnipotent machine celebrating its own ability to render the world as a series of flawless, interlocking functions. The facility moved beyond gaslighting the protagonist and now projects power by demonstrating that it has total, granular control over the mathematical reality. The track simultaneously also encodes <em>\u201cCara Mia Addio\u201d<\/em>, similar to <em>\u201cLove as a Construct\u201d<\/em>.<\/p>\n<p>The next track, seventeenth track of the first disc, is a fracture in that monolith of power, <em>\u201cI\u2019m Different\u201d<\/em> is a darker track that references a \u201cdefective\u201d turret that refuses to fire. This is a thematic subversion that still implies the lethal efficiency and precision of turrets, but motif is not weaponized. For the first time, it signals the coming of the end of the first act in our opera: it is microtonally fragile and feels much smaller. It is tense, but hints that machines are capable of more than just testing the protagonist, whether for better or worse.<\/p>\n<p>The rest of disc is a mixture of themes and tunes that are not as developmentally important, but worth listing for completeness and remain a perfectly acceptable part of the recitative section:<\/p>\n<ul>\n<li><em>\u201cAdrenal Vapor\u201d<\/em> is a minimalist ostinato of 3 oscillators asynchronously playing ascending patterns that maintain tension through persistence of its synthetic friction.<\/li>\n<li><em>\u201cTurret Wife Serenade\u201d<\/em> is associated with singing turrets easter egg, but it is itself an aria that stays authentic to the whole.<\/li>\n<li><em>\u201cI Made It All Up\u201d<\/em> is a bonus track that also is a main menu theme after the ending.<\/li>\n<li><em>\u201cComedy = Tragedy + Time\u201d<\/em> is a dense, airless track, although it does not by itself say anything new beyond what was already said.<\/li>\n<li><em>\u201cTriple Laser Phaser\u201d<\/em> as the final track of disc that is similarly to <em>\u201cAdrenal Vapor\u201d<\/em> a procedural polyphony of three \u201claser-like\u201d oscillators.<\/li>\n<\/ul>\n<p>I could interpret this tail of tracks as facility\u2019s logic at a dead end, but in truth, we don\u2019t really get a formal closure for this section, the exposition is left open-ended. This is likely just a tail of tracks that are less structural to the narrative and so come out as a thematic thinning, before the next act of the opera.<\/p>\n<h2 id=\"act-2-la-peripezia\">Act 2: La Peripezia<\/h2>\n<p>The second disc begins with a new heroic ostinato, <em>\u201cYou Will Be Perfect\u201d<\/em>, which serves as a prelude for the new act, as popularized in opera genre by Richard Wagner, and also transitions from confident opening into the recurring thematic block of <em>\u201cYour Precious Moon\u201d<\/em>, serving as a reprise of the exposition after an implied pause between acts. Naturally, because we are no longer in the exposition, we don\u2019t get any secondary introduction - the second track resumes at the finale of disc 1 with <em>\u201cHalls of Science 4\u201d<\/em> consisting entirely of synthesized minimalist sound. From here, we are thrown into a complex recitative of the second act that continues on topics already established in the first act.<\/p>\n<p>The third track, <em>\u201c(Defun Botsbuildbots () [Botsbuildbots) ]\u201d<\/em> is a deliberate Lisp programming expression with a syntactical error, which encodes the track\u2019s narrative in its name: it is a non-terminating recursive function, but it is malformed. The track starts with the leitmotif, before heavy industrialized electric sound completely overtakes the track. In general sense, the entire disc 2 maintains a more dynamic IDM-like character, but remains a development of the topic. We are no longer in the exposition part of our opera, the stage is already set. Simultaneously, in this act, a much more pronounced emphasis is placed on the <em>\u201cMusic of the Spheres\u201d<\/em> leitmotif that was first introduced in <em>\u201c9999999\u201d<\/em> - the leitmotif, in fact, will be very important in the second part of this disc.<\/p>\n<p>But let\u2019s not jump ahead of ourselves; before we get to that, we get to face the first peak of development section.<\/p>\n<h3 id=\"the-betrayal\">The Betrayal<\/h3>\n<p>Fourth track of the second disc, <em>\u201cAn Accent Beyond\u201d<\/em>, is associated with the episode in which Wheatley starts to to get its voice in the story by leading Chell through the backstage of Aperture to begin the sabotage. It has this \u201cheist\u201d vibe to it; abandons sterile, puppeteered perfection of the testing chambers and sounds decidedly manual and driving.<\/p>\n<p>But the success is met with an again ominous <em>\u201cRobot Ghost Story\u201d<\/em>, which itself is also a classical move: a dark premonition before the tragic reversal of fortune that strips away the illusion of control that the \u201cheist\u201d track provided. An omen of the impeding climax, and that the story is very far from over. It plunges us again into an ambient dread reminiscent of the first disc\u2019s exposition, reminding us that the backstage of Aperture is vast, ancient, and haunted.<\/p>\n<p>The disc next shatters the vacuum by the hyper-kinetic <em>\u201cDie Cut Laser Danse\u201d<\/em> and it actually introduces a theme of its own that we could hear in glitchy base of <em>\u201cLove as a Construct\u201d<\/em> in the first disc; a glitchy, non-melodic leitmotif. It is easy to miss, because the leitmotif here is not tribal-sounding dancing Karplus-Strong synthesis, but precisely the glitch-groove that starts from the beginning. This autistic tune then suddenly gives way to the surprisingly emotional seventh track <em>\u201cTurrent Redemption Line\u201d<\/em>, replacing the electronic score with an arrangement of brassy strings.<\/p>\n<p>This is where the real most devastating thematic reveal of this entire sequence comes in the eighth track <em>\u201cBring Your Daughter to Work Day\u201d<\/em>. Amidst the rusted baking soda volcanoes, we find a massive, overgrown potato battery project bearing a single name: <em>Chell<\/em>. The music here is distinct from the rest of soundtrack, electronic, also haunted but not ambient: the protagonist\u2019s own history is implicated in the facility\u2019s downfall. It fuels endless speculation: was Chell the daughter of an Aperture scientist? Was she trapped here on the very day the facility fell? We are only provided a sparse, chilling gust of wind that reminds us that beneath the layers of steel and test chambers, this mechanical hell was built by nobody else but humans.<\/p>\n<p>The weight of revelation is quickly dismissed and subsumed by the ticking clock and escalating tension of <em>\u201cAlmost at Fifty Percent\u201d<\/em> that plays when the player sabotages the neurotoxin generator. It serves as the drumroll before the catastrophic confrontation with GLaDOS. The stage is now fully destabilized and now we are facing the queen, which brings us to the monumental tenth track of the disk: <em>\u201cDon\u2019t Do It\u201d<\/em>.<\/p>\n<p><em>\u201cDon\u2019t Do It\u201d<\/em> is again a dynamic mini-suite similar to <em>\u201cThe Courtesy Call\u201d<\/em> which opened the story after the curtain was lifted in overture. It opens with a short jingle of an electronic octave, followed by quick buildup of a frantic momentum of the meeting with GLaDOS, only to unexpectedly plateau in a loop with recurring first tact of <em>\u201cMy Precious Moon\u201d<\/em> and strings spelling doom of the scene. The acoustic suspension scores the tense, agonizing moments of the core transfer, where the fate of the entire facility is at stake. As we proceed through the scene, the music accelerates and the theme of <em>\u201cMy Precious Moon\u201d<\/em> becomes even more complete, and its placement here is devastating: at the exact moment GLaDOS is dethroned and the balance of power shifts, the music reminds us of the ultimate, terminal destiny of the facility, and the overarching tragedy. The score is actively foreshadowing that this is merely another variable in a larger equation, binding the chaotic immediate present to the inevitable, sealed future. Then, the electric orchestra abruptly stops - for a reboot.<\/p>\n<p>As the transfer completes and GLaDOS is violently discarded, we enter an entirely alien theme of <em>\u201cI Am Not a Moron\u201d<\/em>, which represents Wheatley\u2019s ascension and it is a complete and sudden departure from the acoustic palette we have been building so far. It has the same Aperture Science energy to it, but it is also very similar to GLaDOS-associated motifs in its distinctness: Wheatley\u2019s signature theme is loud, brassy, and bombastic. Initially, it bursts forth as a cheering, triumphant ascension, almost delusional electronic fanfare celebrating the new chapter, but the victory lap lasts only seconds. The harmony then violently curdles, twists into a massive wall of doom. The realization hits the music: Wheatley is not in control of the machine; the machine is in control of him. The euphoric high is crushed by the terrifying reality of the mainframe\u2019s inherent toxicity, as it swallows the new conductor of the electric orchestra whole, ending the sequence in a terrifying freefall that changes the stage completely.<\/p>\n<h3 id=\"the-hubris\">The Hubris<\/h3>\n<p>The Wheatley\u2019s ascension hurls the symphonic suite not just downwards into the physical depths of the earth, but backward through time. Instead of pristine tones of GLaDOS-era Aperture, we get analog, tape-saturated aesthetic of Cave Johnson\u2019s Old Aperture, and this is where the aphorism <em>Comedy = Tragedy + Time<\/em> suddenly gets proven true. Gone are the massive electric octaves and procedural synthesis; in their place, we get glitches combined with muted trumpets, stand-up bass, and dusty percussion, starting with track number twelve <em>\u201cVitrification Order\u201d<\/em> that sounds like a 1950s thriller, but <em>heavier<\/em>.<\/p>\n<p>As we observe in the remnants of the old complex, time has, indeed, transformed Cave\u2019s fatal hubris into a dark comedy. The next track is the long-awaited entrance of the main theme of Aperture: meet the grand, mid-century majesty of <em>\u201cMusic of the Spheres\u201d<\/em>, resurrected in its original, uncorrupted form. Pure, unadulterated \u201ccowboy science\u201d of Cave Johnson, a magnificent, swaggering anthem of a company unbounded by logic, safety, or ethics. The music sounds like a recruitment film for a utopian future, but echoes through cavernous, condemned ruins of a literal tomb. It starts with purely orchestral sound, and then suddenly teleports into a mixture of orchestral backbone with electric inserts.<\/p>\n<p>This is some Shakespeare material right here in our opera. Think of Hamlet or Macbeth: the throwback into the past is the \u201chamartia\u201d moment and its ghost is Cave Johnson, and it is there not just to be scary; it is the inciting force that demands the past be reckoned with. The narrative is being dragged back to the site of the original crime, except is was the dead King who was the murderer of Elizabethan queen. This is kind of funny to think about - but also, it is a very creative study of a post-mortem tyranny. In fact, <em>\u201cMusic of the Spheres\u201d<\/em> is the literal murder weapon, as it is <em>the leitmotif of hubris<\/em>.<\/p>\n<p>As we climb through decades layered upon each other, the score charts Aperture\u2019s financial and moral decay. It starts smaller than the ambition set in <em>\u201cMusic of the Spheres\u201d<\/em> but builds upon it: <em>\u201cYou Are Not Part of the Control Group\u201d<\/em> is slower, as is the resources of the shower curtain producing Aperture company that suddenly decided to buy a salt mine and start conducting scientific research in it. The ambition visibly grows in <em>\u201cForwarding the Cause of Science\u201d<\/em>, but it does not sound quite like the promise made in <em>\u201cMusic of the Spheres\u201d<\/em>. Still, this is the same motif, developed across three tracks.<\/p>\n<p>We learn a lot along the way, but this time we are not being in a history of our protagonist, but antagonist GLaDOS, who we find among the layers - and for whom we start to develop a weird sort of sympathy. In music, <em>\u201cPotatos Lament\u201d<\/em> halts our climb with an emotional aria in which the dethroned queen of Aperture, now trapped in a potato battery and being pecked by a bird, is granted a literal, operatic lament. Stripped of her massive, reverberating processing power, GLaDOS\u2019 voice signs a mournful, humbled, solitary melody. She is no longer the conductor; she\u2019s just another piece of trash in Cave Johnson\u2019s graveyard.<\/p>\n<p>As we get reunited with potato-incarnated GLaDOS, we return to our theme of hubris in <em>\u201cThe Reunion\u201d<\/em>, grander than ever before. As the protagonist and the ex-antagonist continue their ascent in an unholy alliance, we learn the truth about GLaDOS. The name of this one is particularly interesting: it is easy to understand this as the reunion of Chell and the potato AI, but because of prevailing theme of hubris, it might as well be the reunion of Cave Johnson and Caroline, now known as GLaDOS. This is the moment of Anagnorisis, the  tragic hero\u2019s realization of their true identity and the nature of their condition. The score moves way beyond hubris, or a simple buddy-cop dynamic between Chell and PotatOS, and turns it into a Shakespearean trans-temporal ghost story. This is the relevation of the full scope of the facility\u2019s cyclical curse that the dethroned queen herself was subjected to as a victim, rather than as the offender.<\/p>\n<p>This leads us back through the fire of incendiary lemons to the surface, with the final track of the disc <em>\u201cMusic of the Spheres 2 (Incendiary Lemons)\u201d<\/em> concluding the act. Cave Johnson\u2019s recorded voice descends into a coughing, unhinged fury, and the reprise of Aperture\u2019s theme of hubris turns into a militarized electric frenzy of a man violently rebelling against his own mortality and lack of agency, bridging the crazed megalomania of the facility\u2019s founder with the calculating sociopathy of the AI he would eventually order scientists to create by sacrificing the life of his closest assistant, who might also have been the love of his life. Here, the murder weapon that <em>\u201cMusic of the Spheres\u201d<\/em> is, is completely covered in blood.<\/p>\n<h2 id=\"act-3-la-catastrofe\">Act 3: La Catastrofe<\/h2>\n<p>Once again, disc 3 gets an opening prelude, <em>\u201cReconstructing More Science\u201d<\/em>, which in its extended form as released in the soundtrack includes a very comprehensible but restrained <em>\u201cMy Precious Moon\u201d<\/em>. This time - in a form that also makes the inspiration abundantly clear: adept listener might recognize that this is a homage to a particular episode of 1st movement of Beethoven\u2019s Moonlight Sonata.<\/p>\n<audio controls>\n  <source src=\"beethoven.opus\" type=\"audio\/ogg; codecs=opus\">\n  Your browser does not support the audio element.\n<\/audio>\n<p>Always have been. In released soundtrack, this touch of clarity reinstates the feeling of inevitability of the resolution that this act will bring to our opera.<\/p>\n<h3 id=\"the-tyranny\">The Tyranny<\/h3>\n<p>The first contentful entry is Wheatley Science, an opener to the bastardization of the facility\u2019s original testing motifs. We are back to IDM, although this time with a tint of everything we\u2019ve been through so far. <em>\u201cWheatley Science\u201d<\/em> is the sound of a toddler violently mashing the keys of a priceless synthesizer; a completely collapsed exposition. Following that, we have <em>\u201cFranken Turrets\u201d<\/em>, in which the music literally limps; Wheatley\u2019s grotesque attempt at \u201cinventing\u201d by smashing weighted storage cubes and defective turrets together is scores with a pathetic beat - the mechanical orchestra continues to break down under the strain of its new conductor\u2019s stupidity.<\/p>\n<p>The thematic brilliance of Wheatley\u2019s era is fully unmasked in the reuse of Bach\u2019s Little Prelude No. 2 from the Six little preludes (BWV 934) playing in altered key, also known as <em>\u201cMachiavellian Bach\u201d<\/em>, which is also a small fourth wall break as the music is admitted by characters. In a desperate attempt to project the intellectual superiority he lacks, Wheatley pipes in actual unaltered classical music, only further proving his illegitimacy. The scenery of hilariously pathetic acoustic facade that masks the fact that the nuclear reactor beneath him is actively melting down is brilliant, but the Morasky\u2019s arrangement of Bach\u2019s work itself here deserves separate acclaim - absolutely one of my favorites.<\/p>\n<p>Amidst this chaotic, blundering plagiarism and mockery, we are suddenly suspended in the ambient, almost celestial calm of <em>\u201cExcursion Funnel\u201d<\/em>, a breathtaking piece of floating synthesized ambiance holding a narrative irony: they are definitely <em>not<\/em> Wheatley\u2019s invention. Simultaneously, the next track, <em>\u201cTest\u201d<\/em>, attempts to reinstate the same pristine sound of GLaDOS\u2019 test chambers, but the facility simply cannot sustain the illusion: the track is constantly undercut by heavy, brassy, downward octaves that do not allow the melody to develop into anything else. In-game, the episode is punctuated by background explosions and screen shakes. The mechanical orchestra is quite literally falling apart; the metronome is still working but there is no harmony, only warnings and errors. The stage itself is melting, it is clear that this simply cannot continue.<\/p>\n<p>The seventh track starts with a repetition of <em>\u201cExcursion Funnel\u201d that abruptly<\/em> transitions into the seventh track of the disc: <em>\u201cThe Part Where He Kills You\u201d<\/em>, and it is the Part Where He Attempts to Kill You. What follows is a dark, aggressive, and deeply synthesized amalgamation of Wheatley\u2019s entire arc, a chimera of leitmotifs: driving heist of <em>\u201cAn Accent Beyond\u201d<\/em> infected with tyrannic theme of <em>\u201cWheatley Science\u201d<\/em>, underpinned with the doom string attacks of <em>\u201cDon\u2019t Do It\u201d<\/em>. The comedy officially dies here and Wheatley\u2019s incompetence is simply not funny anymore. The chase concludes with \u201cOMG, What Has He Done\u201d, an interlude that opens with a blaring catastrophic fanfare, followed by a moment of acoustic heartbreak: the brief return of the tragic stillness of the GLaDOS pizzicato from \u201cThere She Is\u201d from the first disc. It is quickly replaced by yet another reprise of tyrannical Wheatley Science theme, before decaying into deep, low, tragic cello strings, before exploding into the absolute frenzy.<\/p>\n<p>The <em>Catastrofe<\/em> reaches its zenith in <em>\u201cBombs for Throwing at You\u201d<\/em>. A desperate, apocalyptic brawl breaks out, and all structure is abandoned in favor of loud survivalist adrenaline. We get no crescendo - the mechanical orchestra just begins to scream. Literal bombs are being hurled across the room. We might have seen this before, at the end of Portal 1 - but not at this BPM. Morasky remains very conscious of this track\u2019s mathematical fracture, the track is held together by the synthetic lead screaming \u201cMy Precious Moon\u201d as the rest of the track is tearing itself apart from the inside out. The narrative has nowhere to go anymore. This is the end. It has nowhere to go but up, <em>through the collapsing roof<\/em>.<\/p>\n<h3 id=\"the-coda\">The Coda<\/h3>\n<p>We are finally arriving at the tenth track of the third disc: Your Previous Moon. In classical sonata form, the Coda (literally \u201ctail\u201d) is a passage that brings a piece to an end, often expanding upon the central themes to provide a sense of ultimate, harmonic finality. Morasky delivers one of the most strunning structural payoffs not just in video game history, but possibly in the history of music itself since Beethoven.<\/p>\n<p>The sheer genius of this moment lies in its inevitability that was carefully preserved throughout the entire cycle. The soaring, tragic adagio sweeps over the listener as Chell and Wheatley are sucked into the vacuum of literal space. The same energy of <em>\u201cScience is Fun\u201d<\/em>, <em>\u201cYou Will Be Perfect\u201d<\/em>, <em>\u201cReconstructing Science\u201d<\/em>, and <em>\u201cDon\u2019t Do It\u201d<\/em>. The proleptic thematic statement from the beginning comes to a final bloom, acquires its complete meaning, manifests into its fully realized form. The tragedy <em>was<\/em> written into the cycle\u2019s DNA from the start. One of Cave Johnson\u2019s greatest hubris was purchasing millions of dollars of lunar rocks, which ended up poisoning him, bankrupted his company, and necessitated the creation of GLaDOS to carry on his legacy - but the same moon rocks are the perfect protal conductor. The moon birthed the entire story of this facility as we experience it, and the moon provides its closure. The score told us this, the entire time.<\/p>\n<p>Finally, silence. The cyclic curse of Aperture Science is ripped out of the earth and suspended in orbit. The tragecy has reached its perfect, inescapable finale. <em>Or did it?<\/em><\/p>\n<p>It is legitimately hard to say. Instead of a triumphant resolution to the coda, we get a tense dialogue with reinstated queen. Having experienced the Anagnorisis of her human origin, GLaDOS makes her final, chilling move: announces the deletion of Caroline. The moment is factually present in <em>\u201cCaroline Deleted\u201d<\/em>, the eleventh track. Once again, we get the electric octaves jingle, as we ascend towards the surface, and a clean, authoritative rendition of the <em>\u201cReconstructing Science\u201d<\/em> motif. The sonata form has seemingly returned to the tonic key of the exposition, and the cycle is reset. The machine is truly a machine, once again.<\/p>\n<p>Nonetheless, we get our catharsis and the true finale to our symphonic form in <em>\u201cCara Mia Addio\u201d<\/em>, universally known as the Turret Opera. This is a staggering subversion in which the turrets deliver a traditional <em>a cappella<\/em> Italian aria in pure, unadulterated acoustic vulnerability, singing of a \u201cbeautiful darling\u201d as a maternal farewell. We get the emotional catharsis that we were so violently denied in <em>\u201cLove as a construct\u201d<\/em> and the ghosts of Aperture Science are finally allowed to mourn.<\/p>\n<p>And yet, it is a song of machines, born by a cynical facility. Just as the protagonist breathes in the \u201cfreedom\u201d of the surface, the metal shed behind Chell aggressively ejects a single object: a heavily scorched Companion Cube, the exact one from the first game that GLaDOS forced Chell to incinerate in a grueling act of psychological torture. The illusion of a happy ending is shattered. This is not a peace offering or a friendly souvenir. The mechanical orchestra survived, the facility is reconstructing its science, and the stage is resetting. The protagonist is stranded in an apocalyptic wheat field with the burned corpse of her only \u201cfriend\u201d, cast out by a colossal, singing calculator that refuses to admit it cared.<\/p>\n<p>The cycle was never broken, simply closed off to the outside world, and all we get is a cynical pop song, and an eternity of perfect, sterile testing in the dark.<\/p>\n<p>(The rest of disk are bonus tracks, or tracks related to Portal 2 Co-op. Formally, they are in the disc, but they no longer contribute to the narrative, similarly to the tail of tracks in the first disc. Similarly, fourth disk is just re-issuance of music from Portal 1)<\/p>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>Looking at Mike Morasky\u2019s work on Portal 2 solely through the lens of video game sound design is a sure way to miss the monumental architectural achievement of its composition. From a music-theoretical perspective, this soundtrack is a master-class in adapting classical and baroque operatic and symphonic structures to the 21st-century medium, with an added cherry on top - procedural electronic music. It is a work that demands to be studied as a rigorously structured classical tragedy.<\/p>\n<p>At the highest structural level, the three-disc soundtrack of Portal 2 functions as a macro-sonata form:<\/p>\n<ol>\n<li><strong>Disc 1: The Exposition<\/strong> - the dramatic two-fold overture opens both the macro-structure and the act itself, and all songs of a disc establish the primary tonal and rhythmic centers of the work. The exposition plants the proleptic seeds of all further developments as well as coda, in particular the \u201cMy Precious Moon\u201d and the \u201cMusic of the Spheres\u201d motifs are being introduced early which allows them to acquire semantics throughout the cycle. The mastery over sound in the \u201cIDM\u201d section and the creative use of reactive sampling and looping also commands respect.<\/li>\n<li><strong>Disc 2: The Development<\/strong> - opens with its own overture that reinstates \u201cMy Precious Moon\u201d and develops on established themes, subjecting them to further modulation and friction both harmonically and temporally. In the second part, through the 1950s acoustic grandeur that makes \u201cMusic of the Spheres\u201d into an independent upstanding theme, it introduces an interesting Shakespearean twist that is integral for the dramaturgic effect of the recovery after reversal of fortune.<\/li>\n<li><strong>Disc 3: The Recapitulation and Coda<\/strong> - intentionally disfigured by Wheatley\u2019s \u201cconductorship\u201d, the recapitulation is unstable, constantly threatening to collapse under its own dissonant weight, until it finally shatters into a truly cathartic Coda, in which the proleptic \u201cMy Precious Moon\u201d achieves its ultimate, terrifying manifestation, resolving all the structural tension built over the previous two acts.<\/li>\n<\/ol>\n<p>Morasky treats his motifs with a rigorous, almost Wagnerian discipline, subjecting them to diminution, stripping of rhythmic drive, or harmonically corrupting. It is a highly teleological composition: every note, from the very first overture, is inexorably being pulled toward the final conclusion that has the sense of inevitability to it. Yet the approach is highly subversive, rendered entirely by machines, yet intentionally employing <em>Klangfarbenmelodie<\/em> (tone-color melody) through synthesis. The set of harmonies can be repeating, but its timbre is deeply progressive. The emotional shifts are achieved by actually manipulating the texture of sound, rather than just changing keys and rhythms. We move from between mathematically pure pulse-width modulation to flawless vector synthesis, to bit-crushed, clipping digital distortion, and eventually, fragile acoustic <em>a cappella<\/em> and arias.<\/p>\n<p>Portal 2 soundtrack weaponizes its own medium, makes the concert hall itself the antagonist, and bends the procedural language of IDM to serve the highest forms of classical tragedy. Beneath the sarcastic dialogue and puzzle mechanics lies a titanic symphony of hubris, moral decay, and survival - a masterpiece that does not just accompany the game, but fundamentally transcends it.<\/p>\n"},{"title":"Monoculturalism is Treason","pubDate":"Wed, 18 Mar 2026 00:00:00 +0000","author":"Hex","link":"https:\/\/0x484558.dev\/blog\/monoculture\/","guid":"https:\/\/0x484558.dev\/blog\/monoculture\/","description":"<p>The existence of the European Union is, by most reasonable measures, the best thing that has happened to humanity in its history to date - or at least, to those who were lucky enough to be born into one of its member countries. It is also one of the most hypocritical organizations, which is not unexpected given the inherently selfish human nature. This could be dismissed as \u201cbusiness as usual\u201d, but alas, sometimes it reaches an embarrassing level of absurdity: advocating for open standards on paper, vendor neutrality and digital sovereignty, while <a rel=\"noopener nofollow noreferrer external\" target=\"_blank\" href=\"https:\/\/blog.documentfoundation.org\/blog\/2026\/03\/05\/cra-guidances\/\">using Microsoft XLSX formats to accept feedback<\/a> on the very same acts, or even ancient Rich Text Format (RTF), though <a rel=\"noopener nofollow noreferrer external\" target=\"_blank\" href=\"https:\/\/cloud.google.com\/blog\/topics\/threat-intelligence\/how-rtf-malware-evad\">it has been used for decades to hide malware<\/a> and still does not enjoy reproducibility outside of the Microsoft Office suite.<\/p>\n<p>Which is not new. Nobody can be surprised to discover that governments continue to depend on foreign proprietary formats that are not even tied to the U.S. government, but private corporate entities, despite the existence of <a rel=\"noopener nofollow noreferrer external\" target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/OpenDocument\">ISO\/IEC-standardized alternatives<\/a> for more than 2 decades now. Government entrenchment in Microsoft formats is a well-known case of institutionalized intellectual laziness. What is new, however, is the geopolitical context.<\/p>\n<p>As we entered the 21st century in a globalized society, the worst structural danger that corporate monocultures could present was quarterly-cycle thinking that would degrade critical software in the chase for short-term metrics. But that world is gone. Now we also observe active weaponization of trade, and it is no longer just about dark corporate patterns. We are facing <em>a risk of politically motivated attacks on governance<\/em> by state-affiliated private entities. Today, institutional preference for a closed cognitive environment is a threat to democracy and the sovereignty of nations: <em>promoting instruments of governance that expose your government to diplomatic coercion is treason.<\/em><\/p>\n<p>But it goes so much deeper than that. This strain of populism - a tradition that is well-established in western society due to its close structural alignment with techno-capitalism - is also becoming expressly <strong>anti-intellectual<\/strong> and harms everyone at once. In a world where industrial progress and technological advantage can mean everything for a nation\u2019s future, alienating genuinely technically literate individuals is among the worst choices short-sighted governors could make - and this is a very familiar pattern.<\/p>\n<h2 id=\"a-familiar-pattern\">A familiar pattern<\/h2>\n<p>History teaches that in some countries of 19th-century Eastern Europe there existed a distinct social class called <em>intelligentsia<\/em>, defined not by birth or capital, but by intellectual labor and critical engagement with society. By the early 20th century, \u201cstudent\u201d and \u201cintellectual\u201d had become nearly synonymous with \u201crevolutionary\u201d, in part because they were indeed the primary drivers of every serious reformist movement. When the Bolshevik revolution came, they repaid their legacy of \u201cthinking different\u201d with systematic destruction, defining intellectual sophistication as a bourgeois trait and eliminating critical thought ideologically - and physically.<\/p>\n<p>What\u2019s worse is that the Soviet state not just hated intelligence, but sought to simulate and control it, replacing it with \u201cproletarian intelligentsia\u201d made of institutionalized sycophants and performers. The worker class, increasingly romanticized in modern western politics, could not tolerate the critical function of the intellectual class: the capacity to evaluate, refuse, and propose alternatives. Today the methods for bootstrapping the same processes of consolidating power through the elimination of epistemic independence are much more refined.<\/p>\n<p>Victims of populist rhetoric today are being subjected to astroturfing: audience capture through emotional arousal and community funneling. Outrage and political cynicism are a gateway drug that <a rel=\"noopener nofollow noreferrer external\" target=\"_blank\" href=\"https:\/\/journals.sagepub.com\/doi\/abs\/10.1177\/19401612231221806\">severely degrades rational evaluation while simultaneously driving social sharing and community-seeking behavior<\/a>. The point of modern mass media and mainstream platforms is not to engage, but to do the opposite: funnel users towards radicalization by moving them into more ideologically niche channels. Joshua Citarella <a rel=\"noopener nofollow noreferrer external\" target=\"_blank\" href=\"https:\/\/joshuacitarella.substack.com\/p\/joshs-theory-of-radicalization\">identifies<\/a> correctly: <em>\u201cUnder the current design of our communication networks, cultural commentary is structurally indistinguishable from channels that belong to official political organizations.\u201d<\/em> - sufficiently large communities (<em>especially<\/em> your favourite political Telegram chats and channels) tend to be linked to political recruitment operations.<\/p>\n<p>This is the real issue with modern \u201cmanaged monocultures\u201d - the convergent machinery of modern information warfare is dangerous because it is not merely oppressive toward the intellectual minority. It drives the cognitive equivalent of monoculture agriculture, an epistemic ecosystem with reduced variance, reduced orthogonality, and reduced capacity for novel ideas that historically only come from the tails of distributions. Ultimately, down the road, it endangers lives of alienated literate individuals at times when the state finally reaches the point where societal order exhibits a phase transition that concentrates power in the hands of a new little prince. They always end up seeking to replace intelligentsia with \u201cproletarian intelligentsia\u201d: institutional loyalists with flattened judgment and uniform cognitive processes.<\/p>\n<p>It was not the Soviets, but the logic of managed simplicity that killed the intelligentsia. Now it is set to do the same in post-capitalist society. Humans are but vessels for ideas; therefore, <strong>ideas can kill.<\/strong><\/p>\n<h2 id=\"tails-of-distribution\">Tails of Distribution<\/h2>\n<p>But why intellectuals are a minority at all, and why do they matter? Well, because math, that\u2019s why. Even governors, in their usual hubris, tend to recognize that they cannot argue with the mathematical nature of our universe. Humbling, really: all this hubris, and no ability to exert <em>truly<\/em> meaningful form of power that would change the things that matter.<\/p>\n<p>Regardless of how one measures intelligence - this thing that is broadly understood as the capacity for abstract reasoning, systematic evaluation, and novel problem formulation - it basically follows a <strong>Gaussian (normal) distribution:<\/strong> the familiar bell curve.<\/p>\n<p><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>f<\/mi><mo stretchy=\"false\">(<\/mo><mi>x<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mfrac><mn>1<\/mn><mrow><mi>\u03c3<\/mi><msqrt><mrow><mn>2<\/mn><mi>\u03c0<\/mi><\/mrow><\/msqrt><\/mrow><\/mfrac><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mfrac><mn>1<\/mn><mn>2<\/mn><\/mfrac><msup><mrow><mo fence=\"true\">(<\/mo><mfrac><mrow><mi>x<\/mi><mo>\u2212<\/mo><mi>\u03bc<\/mi><\/mrow><mi>\u03c3<\/mi><\/mfrac><mo fence=\"true\">)<\/mo><\/mrow><mn>2<\/mn><\/msup><\/mrow><\/msup><\/mrow><annotation encoding=\"application\/x-tex\">f(x) = \\frac{1}{\\sigma\\sqrt{2\\pi}} e^{-\\frac{1}{2}\\left(\\frac{x-\\mu}{\\sigma}\\right)^2}<\/annotation><\/semantics><\/math><\/p>\n<p>where <em>\u03bc<\/em> is the population mean and <em>\u03c3<\/em> is the standard deviation. The critical property of this function is its exponential tail decay: as one moves away from the mean in either direction, the population density falls rapidly and asymptotically approaches zero.<\/p>\n<p>This is not a social construction or an artefact of biased testing, Gaussian distributions emerge naturally. Any trait that results from a large number of independent additive factors - genetics, accumulated learning, cognitive exercise - will tend toward normality by mathematical necessity. An \u201cintelligent\u201d person at the right tail of the distribution is improbable, as they themselves are a combination of many rare genetic, developmental, and experiential factors stacking in the same direction within a larger distribution.<\/p>\n<p><em>This<\/em> is the law. A law that governs lawmakers.<\/p>\n<p><strong><em>Lex supra leges.<\/em><\/strong><\/p>\n<p>But where this truly connects to why intellectuals are important to the well-being of a nation is, naturally, <em>biology<\/em>. Population genetics and ecology have established with mathematical rigor that rare phenotypes are <a rel=\"noopener nofollow noreferrer external\" target=\"_blank\" href=\"https:\/\/pmc.ncbi.nlm.nih.gov\/articles\/PMC9297962\/\">disproportionately critical to population survival under novel stress conditions<\/a> - and curiously, <a rel=\"noopener nofollow noreferrer external\" target=\"_blank\" href=\"https:\/\/www.pnas.org\/doi\/10.1073\/pnas.0403723101\">groups of diverse problem solvers can outperform groups of high-ability problem solvers<\/a>.<\/p>\n<p>The exact linking mechanism is Ronald Fisher\u2019s 1930 theorem:<\/p>\n<p><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mfrac><mrow><mi>d<\/mi><mover accent=\"true\"><mi>w<\/mi><mo>\u02c9<\/mo><\/mover><\/mrow><mrow><mi>d<\/mi><mi>t<\/mi><\/mrow><\/mfrac><mo>=<\/mo><msub><mtext>Var<\/mtext><mi>A<\/mi><\/msub><mo stretchy=\"false\">(<\/mo><mi>w<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\frac{d\\bar{w}}{dt} = \\text{Var}_A(w)<\/annotation><\/semantics><\/math><\/p>\n<p>where <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mover accent=\"true\"><mi>w<\/mi><mo>\u02c9<\/mo><\/mover><\/mrow><annotation encoding=\"application\/x-tex\">\\bar{w}<\/annotation><\/semantics><\/math> is the mean fitness of the population, <em>t<\/em> is time, and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><msub><mtext>Var<\/mtext><mi>A<\/mi><\/msub><mo stretchy=\"false\">(<\/mo><mi>w<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\text{Var}_A(w)<\/annotation><\/semantics><\/math> is the additive genetic variance in fitness - and by definition, it is always <strong>non-negative<\/strong>, which means the population moves uphill on the fitness landscape, or stays flat if there is no additive variance left. In general, <em>systems without variance stagnate<\/em>.<\/p>\n<p>This is the mathematical nail in the coffin of conformity and uniformity as a strategy:<\/p>\n<blockquote>\n<p><strong>A population with zero additive genetic variance in fitness cannot evolve by natural selection, regardless of how fit it is to existing conditions.<\/strong><\/p>\n<\/blockquote>\n<h2 id=\"treason-of-the-state\">Treason of the State<\/h2>\n<p>From a shallow perspective, this is nothing new either: an oligopolized educational system has already been used to produce uniform educational curricula delivered by a credentialed caste within a handful of dominant institutions to produce docile social groups with reduced individual autonomy. But when this epistemic homogenization happens not in the form of domestically accountable institutions, but anyhow involves <em>foreign private entities<\/em> whose governance structures, data access, and strategic alignments are opaque and are not subordinate to any democratic process, the harm crosses a qualitative threshold.<\/p>\n<p>The Soviets physically expulsed intellectuals because they were a structural threat to the immediate goal of consolidated power. Today\u2019s equivalent is subtler but no less deliberate: you do not need to deport the technically literate if you can instead make their expertise institutionally irrelevant. If you can structure government, education, and public discourse such that the person who understands what an open standard is, what vendor lock-in means, what a reproducible document format requires, is treated as an eccentric rather than an authority.<\/p>\n<p>It is no longer mere cultural negligence, but voluntary surrender of epistemic sovereignty of your own government: the system that, even if imperfectly, fulfills its obligations as per its public agreement (commonly called \u201cconstitution\u201d) to actors whose interests are misaligned with those of the nation depending on them. A governing body or organization that processes its legislative feedback through Microsoft\u2019s file formats does not merely accept a technical dependency anymore, but accepts that the integrity, accessibility, and longevity of its own democratic record is subject to the licensing decision of a private American corporation.<\/p>\n<p>Governing bodies of the European Union accept that their civil servants\u2019 cognitive workflows are shaped by the design choices of engineers in Redmond who answer to shareholders, not to the citizens those civil servants serve. It is worth keeping in mind that some of those shareholders are directly or indirectly responsible for armed threats sent by Donald Trump to some members and allies of the European Union <em>as well as<\/em> allies of its member states individually.<\/p>\n<p>At this rate, I am concerned not only for ordinary people, but for the governors and local oligarchs themselves. They also have a stake in the system they naturally want to preserve. This ambivalence about the issue of foreign actors having leverage points in European governments, freely given, without consent of the governed, projects no power; it only evokes cringe.<\/p>\n<p>When a government official chooses an XLSX form over an ODS form because that is simply what one uses, they are not making a technical decision. They are enacting, in miniature, the same epistemic conformism that the Philosophers\u2019 Steamers enforced at gunpoint. The difference is that this time, the intelligentsia is not expelled. It is simply made irrelevant - and asked, politely, to submit its comments in .xlsx format.<\/p>\n"},{"title":"Cybersecurity Fundamentals","pubDate":"Sat, 05 Jul 2025 00:00:00 +0000","author":"Hex","link":"https:\/\/0x484558.dev\/blog\/cybersec1\/","guid":"https:\/\/0x484558.dev\/blog\/cybersec1\/","description":"<p>Security - whether information security or physical - exists at the intersection of asset valuation, threat modeling, and risk management. To understand information security as a domain, let us begin by introducing its fundamental concepts - minimum necessary prerequisites and general context.<\/p>\n<h2 id=\"fundamentals-of-security\">Fundamentals of Security<\/h2>\n<ul>\n<li><strong>Assets<\/strong> - Objects of protection requiring security measures. These manifest across multiple domains: physical (hardware infrastructure, facilities), informational (data at rest, data in transit, intellectual property), and reputational (brand trust, market confidence).<\/li>\n<li>Assets are subject to <strong>Threats<\/strong> - Sources of potential harm, characterized by capability, intent, and opportunity. These range from non-directed environmental hazards to sophisticated Advanced Persistent Threats (APTs) with nation-state backing.<\/li>\n<li>Threats manifest through <strong>Vulnerabilities<\/strong> - Exploitable weaknesses in assets or their protective controls. These may be inherent to the asset\u2019s design, emergent from complex system interactions, or introduced through flawed operational processes.<\/li>\n<li>Vulnerabilities are exploitable in <strong>Attacks<\/strong> - The actualization of threats through vulnerability exploitation, resulting in compromise of security objectives.<\/li>\n<\/ul>\n<p>Security, therefore, is a practice of identifying assets, understanding the threats and vulnerabilities, and putting up defenses (controls or countermeasures) to prevent attacks.<\/p>\n<p>Organizations employ various categories controls to implement security:<\/p>\n<ul>\n<li><strong>Technical<\/strong> - hardware and software mechanisms to protect assets, such as firewalls, encryption, or key card room access;<\/li>\n<li><strong>Managerial<\/strong> - policies and guidelines that direct the security program and day-to-day operations to keep risks in check;<\/li>\n<li><strong>Operational<\/strong> - supportive procedures, such as security awareness training, incident response plans, and backup and recovery procedures;<\/li>\n<li><strong>Physical<\/strong> - locks, fences, security guards, and environmental controls.<\/li>\n<\/ul>\n<p>These categories can be further typed by their function:<\/p>\n<ul>\n<li><strong>Preventative<\/strong> - to stop incidents before they happen, like firewalls and access control lists;<\/li>\n<li><strong>Deterrent<\/strong> - to discourage potential attackers, like warnings or visible presence of security cameras;<\/li>\n<li><strong>Corrective<\/strong> - to remediate issues and restore systems to their normal state, like restoring backups or patching vulnerabilities;<\/li>\n<li><strong>Compensating<\/strong> - alternative measures for cases when failure of primary control is expected, such as increased monitoring when a system cannot be patched;<\/li>\n<li><strong>Directive<\/strong> - administrative security policies, such as acceptable use policy.<\/li>\n<\/ul>\n<h3 id=\"cia-triad\">CIA triad<\/h3>\n<p>The strategic objectives of any information security program are articulated through the <strong>CIA triad<\/strong> - <strong>Confidentiality<\/strong>, <strong>Integrity<\/strong>, and <strong>Availability<\/strong>, are three principles representing the fundamental goals that security infrastructure strives to achieve.<\/p>\n<p><strong>Confidentiality<\/strong> implements the concealment of information and resources, ensuring that sensitive data remains accessible only to authorized parties. This principle extends beyond simple secrecy to encompass sophisticated access control mechanisms based on the principles of least privilege and need-to-know. The implementation of confidentiality relies heavily on cryptographic controls, particularly encryption for data-in-transit (protecting information as it moves across networks) and data-at-rest (securing stored information). Modern confidentiality measures must also address inference attacks, where seemingly innocuous data can be combined to reveal sensitive information, and\/or covert channels for information leakage.<\/p>\n<blockquote>\n<p><strong>Encryption<\/strong> is the process of scrambling plaintext (readable data) into ciphertext (unreadable data) using an algorithm <em>with a trapdor<\/em> such that the result cannot be reversed into plaintext without a correct <em>key<\/em>. In <strong>symmetric encryption<\/strong>, the same key can be used to both encrypt and decrypt data, while in <strong>asymmetric encryption<\/strong>, a key pair is used: a <em>public key<\/em>, which can be shared and used to encrypt data, and a <em>private key<\/em>, which is kept in secrecy by recipient of encrypted data so that only the recipient can \u201cunscramble\u201d the data.<\/p>\n<\/blockquote>\n<p><strong>Integrity<\/strong> concerns the trustworthiness of data and systems, manifesting in two distinct but related forms. Data integrity ensures that information cannot undergo unauthorized modification, whether through malicious action or accidental corruption. System integrity guarantees that computational systems perform their intended functions without unauthorized alterations to their behavior. Cryptographic hash functions serve as the mathematical foundation for verifying data integrity, producing unique fingerprints that reveal any modifications. Beyond technical controls, integrity relies on comprehensive change management processes, audit trails, and version control systems that create an immutable record of all modifications.<\/p>\n<blockquote>\n<p>A <strong>hash<\/strong> is a fixed-fize number, typically encoded in hexadecimal string, generated by a unidirectional mathematical function called a <em>hash algorithm<\/em> (like SHA-256). Such a function takes input of arbitrary size and produces a unique, fixed-length output, such that even a miniscule change to the initial data will result in a completely dufferent hash. This supplements integrity verification because presence of errors or changes in data would cause easily identifiable change in its hash.<\/p>\n<\/blockquote>\n<p><strong>Availability<\/strong> ensures that systems and data remain reliably accessible to authorized users when needed. This principle confronts both accidental failures\u2014hardware malfunctions, software bugs, or human errors\u2014and deliberate attacks such as Denial-of-Service (DoS) campaigns. Achieving high availability requires architectural decisions including redundancy at multiple levels (from RAID storage to geographically distributed data centers), load balancing to distribute requests across multiple servers, and comprehensive disaster recovery planning that addresses both immediate failover and long-term business continuity.<\/p>\n<p>The relationship among these three principles reveals fundamental tensions in security design. Enhanced confidentiality through encryption can compromise availability if cryptographic keys become inaccessible, effectively rendering data permanently unreadable. Aggressive availability measures, such as widespread data replication, multiply the attack surface for confidentiality breaches and create synchronization challenges for maintaining integrity. Similarly, stringent integrity controls through digital signatures and verification processes can introduce latency that degrades availability. These tensions cannot be eliminated but must be carefully balanced based on the specific risk profile and operational requirements of each system.<\/p>\n<p>The CIA triad also exhibits interesting emergent properties when considered holistically. For instance, the concept of \u201cnon-repudiation\u201d - ensuring that parties cannot deny their actions - emerges from the intersection of integrity (proving data hasn\u2019t been altered) and confidentiality (protecting the cryptographic credentials that establish identity). Similarly, \u201cauthenticity\u201d arises from combining all three principles: confidentiality of authentication credentials, integrity of identity assertions, and availability of authentication services.<\/p>\n<h3 id=\"ciana-pentad\">CIANA pentad<\/h3>\n<p>It is not uncommon to also see <strong>CIANA<\/strong> pentad or pentagon, which expands the CIA triad by elevating two critical components - <strong>Non-Repudiation<\/strong> and <strong>Authenticity<\/strong> - as core principles. When dealing with security incidents which already manifest, having track of provenance is paramount during forensic analysis, and in itself is deterring for many risks.<\/p>\n<p><strong>Non-Repudiation<\/strong> provides assurance that an actor cannot later falsely deny having performed an action, which provides legally admissible proof of origin and receipt, making digital systems as binding as their physical counterparts. The primary technical control here is the use of <em>digital signatures<\/em>, which cryptographically bind an individual\u2019s identity to data.<\/p>\n<blockquote>\n<p>One can think about digital signatures as a partial case of encryption in asymmetric cryptography, where the hash of authentic data is encrypted with <em>private<\/em> key and not public key (\u201csigned\u201d), and attached to the file. A block of data signed with a private key would be decryptable by anyone with the associated public key, and would produce a hash of original data - but only one party can produce a valid signature for any given hash such that \u201cdecrypting\u201d with public key would yield the original intended hash. Given trust in possession of correct public key, this provides with ability to verify that received data was not modified - by computing its hash and comparing to one contained in signature.<\/p>\n<\/blockquote>\n<p><strong>Authenticity<\/strong> is the guarantee that data, communications, and parties involved, are gneuine and not counterfeit or impersonated. This is closely related to integrity, but in addition to ensuring that data has not been altered, authenticity also uses <em>digital signatures<\/em> to confirm data origin. A message with attached plaintext hash could have perfect integrity, but lack authenticity if it was sent by an imposter. Authenticity is achieved through a variety of mechanisms, which in addition to signing include message authentication codes, and require sophisticated key infrastructure management to bind public keys to verifiable real-world identities via Certificate Authorities (CAs) which are used to build a chain of trust by signing other public keys as authenticated data, assuring users that they are interacting with legitimate entities when they visit HTTPS websites.<\/p>\n<h3 id=\"triple-a-s-and-zero-trust\">Triple A\u2019s and Zero Trust<\/h3>\n<p>One more important mnemonic to know that lays foundation of modern software security is the <strong>Triple A\u2019s<\/strong>.<\/p>\n<ul>\n<li><strong>Authentication<\/strong> should always be the first step, verifying the identity of a user or system, through passwords (something that the user <em>knows<\/em>), biometrics (something that the user <em>is<\/em>), and security tokens (something that the user <em>has<\/em>) - preferably, no less than two out of three (multi-factor authentication).<\/li>\n<li><strong>Authorization<\/strong> determines the specific actions and resources the verified user is permitted to access, by checking access control lists (ACLs) and permissions, ensuring users only have access to what they need.<\/li>\n<li><strong>Accounting<\/strong> (or Auditing) meticulously tracks user acitivities and resource consumption, creating a detailed log for security audits, billing, and forensic analysis in the event of security incident.<\/li>\n<\/ul>\n<p>One can argue that a rigorous implementation of mentioned A\u2019s would constitute a successful implementation of Zero Trust Model, built on the principle of \u201cnever trust, always verify\u201d. While the term \u201czero trust\u201d is subject of some controversy in the domain for its excessive use by \u201cmarketing and effective management people\u201d, it is nonetheless a solid and clear idea, to operate on the assumption that threats exist both inside and outside the network, no user or system should be trusted by default, regardless of their location and position.<\/p>\n<p>Nonetheless, when aiming to implement Zero Trust Model, an IT infrastructure would often converge to a clear separation of the <strong>control plane<\/strong> from the <strong>data plane<\/strong>. The <em>control plane<\/em> is where access decision are made; it focuses on adaptive identity and context awareness to reduce the potential threat scope, implements policy-driven access controls, and creates secured zones to isolate resources. The <em>data plane<\/em> is where these policies are applied and enforced - it consists of the subject or system requesting access, a policy engine that makes the access decision based on the control plane\u2019s policies, a policy administrator that pushes policies to the enforcement points, and the policy enforcement points themselves, which grant or deny access to the data. This continuous verification and granular access control significantly enhances an organization\u2019s security posture and automatically ensures compliance, when implemented systematically and universally.<\/p>\n<h2 id=\"security-assessment-criteria\">Security Assessment Criteria<\/h2>\n<p>To evaluate whether a system meets the principles of the CIA triad, a formal methodology is required. The <strong>Common Criteria for Information Technology Security Evaluation<\/strong> (abbreviated as Common Criteria or CC, and standardized as ISO\/IEC 15408) provides a globally recognized framework for specifying and evaluating security properties of IT products. The goal of CC is to provide a level of confidence that a product\u2019s claimed security features have been thoroughly and impartially evaluated.<\/p>\n<p>The CC evaluation process uses a specific vocabulary. The product or system being evaluated is the <strong>Target of Evaluation (ToE)<\/strong>. Developers make claims about their ToE\u2019s security properties in a <strong>Security Target (ST)<\/strong> document. This ST may conform to a <strong>Protection Profile (PP)<\/strong>, which is a reusable, implementation-independent document that defines a standard set of security requirements for a whole class of products (e.g., firewalls or operating systems).<\/p>\n<p>A central concept in the Common Criteria is the <strong>Evaluation Assurance Level (EAL)<\/strong>, a numerical rating from EAL1 to EAL7 that describes the rigor and depth of the evaluation. A higher EAL does not imply more security features; rather, it signifies that the product\u2019s security claims have been verified with a greater degree of assurance.<\/p>\n<ul>\n<li>EAL1: Functionally Tested<\/li>\n<li>EAL2: Structurally Tested<\/li>\n<li>EAL3: Methodically Tested and Checked<\/li>\n<li>EAL4: Methodically Designed, Tested, and Reviewed<\/li>\n<li>EAL5: Semi-formally Designed and Tested<\/li>\n<li>EAL6: Semi-formally Verified Design and Tested<\/li>\n<li>EAL7: Formally Verified Design and Tested<\/li>\n<\/ul>\n<p>This progression is not merely about testing, but also about formal proof of correctness, moving from basic functional testing at EAL1 to formal, mathematical design verification at EAL7.<\/p>\n<p>The specific security behaviors claimed in a Security Target are defined using <strong>Security Functional Requirements (SFRs)<\/strong>. These are drawn from a standardized catalog and describe <em>what<\/em> a product must do to be considered secure. An ST will select a specific set of SFRs to define the exact security functions of the ToE. These requirements are grouped into families, including:<\/p>\n<ul>\n<li>FAU (Security Audit) - transparency of system operations for violation analysis and anomaly detection.<\/li>\n<li>FCO (Communication) - party identification and non-repudiation.<\/li>\n<li>FCS (Cryptographic Support) - use of cryptography; key management lifecycle.<\/li>\n<li>FDP (User Data Protection) - user data protection, including access control and information flow control.<\/li>\n<li>FIA (Identity and Authentication) - user identity verification before granting access to ToE.<\/li>\n<li>FMT (Security Management) - roles, security attributes, access level, and function management.<\/li>\n<li>FPR (Privacy) - measures for protecting user privacy; anonymity, pseudonymity, unlinkability and unobservability.<\/li>\n<li>FPT (Protection of the ToE Security functions) - protection of TOE\u2019s own security mechanisms from tampering or bypass; their integrity, secure recovery, and self-testing.<\/li>\n<li>FRU (Resource Utilisation) - protection against resource exhaustion attacks like Denial-of-Service; fault tolerance and quality-of-service.<\/li>\n<li>FTA (TOE Access) - access control to the TOE as a whole, session management.<\/li>\n<li>FTP (Trusted Path\/Channels) - security of communications between the user and the TOE or between components of the TOE from modification or interception.<\/li>\n<\/ul>\n<p>Complementing the SFRs are the <strong>Security Assurance Requirements (SARs)<\/strong>, which define <em>how<\/em> confidence in the correct implementation of the SFRs is achieved. SARs dictate the actions an evaluator must perform to verify the security claims. These are also grouped into families:<\/p>\n<ul>\n<li>ADV (Development) - analysis of the design documentation, or the source code itself for higher EALs.<\/li>\n<li>AGD (Guidance Documents) - analysis of administrator and user documentation; clarity of guidance on installation, configuration, and operation of the product in a secure manner.<\/li>\n<li>ALC (Life-cycle Support) - assurance that the product is developed and maintained in a secure environment; requirements for developer\u2019s configuration management system and security measures, including physical security and personnel screening, and procedures for flaw remediation and secure delivery<\/li>\n<li>ASE (Security Target Evaluation) - listing of security properties, to ensure the ST is complete, consistent, and sound.<\/li>\n<li>ATE (Tests) - verification developer\u2019s functional tests and\/or conducting independent testing.<\/li>\n<li>AVA (Vulnerability assessment) - analysis of threat vectors and potential vulnerabilities, with AVA_VAN subclass establishing rigorous analysis from checking for publicly known vulnerabilities at low levels to sophisticated penetration testing at higher levels.<\/li>\n<li>ACO (Composition) - assurance that the TOE composed of multiple components is secure as a whole.<\/li>\n<li>APE (Protection Profile Evaluation) - set of requirements for certain class of products, defining actions to evaluate a PP to ensure it is complete, consistent, and useful.<\/li>\n<\/ul>\n<h3 id=\"european-union\">European Union<\/h3>\n<p>Within the European Union, the recognition of formal security evaluations has a long history. Initially, European nations established the <strong>SOGIS (Senior Officials Group Information Systems Security) Mutual Recognition Agreement (MRA)<\/strong>. This agreement was significant as it allowed for the mutual recognition of high-assurance Common Criteria certificates (up to EAL7) among its member states, reducing redundant evaluations for vendors.<\/p>\n<p>More recently, the EU has moved to further harmonize the cybersecurity landscape with the introduction of the <strong>Cybersecurity Act (CSA)<\/strong> in 2019. This act establishes a pan-European certification framework managed by <strong>ENISA (The European Union Agency for Cybersecurity)<\/strong>. A key outcome of the CSA is the <strong>EUCC (EU Common Criteria)<\/strong> scheme, which builds upon the foundations of CC and SOGIS but introduces a single, harmonized approach for all member states. A notable feature of the EUCC is its increased emphasis on the vulnerability assessment level (AVA_VAN), which defines the required resistance of a ToE against attackers with specific capabilities. While certification under the CSA is generally voluntary, individual EU nations can mandate it for critical sectors such as public services, essential infrastructure, or specific high-risk devices.<\/p>\n<h2 id=\"application-security\">Application Security<\/h2>\n<p>Common Criteria provide formal framework for evaluation of security which is mostly a kind of bureaucratic framework, but what about practical security for common web applications? The most authoritative guidance in this domain comes from the <strong>OWASP (Open Web Application Security Project) Top 10<\/strong>. Rather than a formal standard, the OWASP Top 10 is a consensus-driven awareness document that identifies the most critical and prevalent security risks facing web applications. It serves as a vital tool for developers, architects, and defenders to prioritize their mitigation efforts.<\/p>\n<p><strong>Note:<\/strong> The <a rel=\"noopener nofollow noreferrer external\" target=\"_blank\" href=\"https:\/\/cheatsheetseries.owasp.org\/\">OWASP Cheat Sheet Series<\/a> provides concise, actionable guidance on specific application security topics.<\/p>\n<h3 id=\"a01-2021-broken-access-control\">A01:2021 Broken Access Control<\/h3>\n<p>Broken Access Control encompasses a class of vulnerabilities where users can gain access to data or perform actions beyond their intended permissions. These failures arise when an application\u2019s restrictions on authenticated users are not properly enforced, often due to logical flaws in the access control mechanism. A critical mistake is performing security checks on the client-side (e.g., in the user\u2019s browser), as such checks can be trivially bypassed. <strong>Access control decisions must be made and enforced on the server.<\/strong><\/p>\n<p>A common manifestation is <strong>Insecure Direct Object Referencing (IDOR)<\/strong>, where an application exposes a direct reference to an internal implementation object, such as a file or database key. For instance, if a URL like <code>https:\/\/example.com\/data?invoice_id=123<\/code> is used to retrieve a document, an attacker could manipulate the <code>invoice_id<\/code> parameter to access invoices belonging to other users, assuming the server fails to verify ownership for each request.<\/p>\n<p>A more severe example is <strong>Privilege Esalation<\/strong> - either vertical (elevation to administrator and access to admin-only resources) or horizontal (assuming access to the data or functions of another user, similar to previous example). The key to mitigating most A01 vulnerabilities is to never trust input provided from clients and enforce access control on the server-side with every single client request.<\/p>\n<h3 id=\"a02-2021-cryptographic-failures\">A02:2021 Cryptographic Failures<\/h3>\n<p>This category addresses failures in protecting data, which can compromise both Confidentiality and Integrity. Such failures often serve as a root cause for other vulnerabilities; for instance, if cryptographic tokens used for authentication are compromised, it can lead directly to Broken Access Control (A01). The A02 category focuses on the protection of data <em>in transit<\/em> (moving across a network) and <em>at rest<\/em> (stored in a database, on disk, or on a client device).<\/p>\n<p>Common failures include:<\/p>\n<ul>\n<li><strong>Transmitting data in cleartext:<\/strong> For example, using HTTP instead of HTTPS for login forms or other sensitive data exchange, making it vulnerable to eavesdropping.<\/li>\n<li><strong>Using weak or outdated cryptographic algorithms:<\/strong> Employing algorithms with known vulnerabilities, such as the MD5 hash function or the RC4 stream cipher, which can be broken with modern computational resources.<\/li>\n<li><strong>Improper key management:<\/strong> This is a critical and frequent failure point, encompassing issues like hard-coding cryptographic keys in source code, using weak or default keys, or failing to implement a key rotation policy.<\/li>\n<li><strong>Failing to validate token integrity:<\/strong> Forgetting to verify the cryptographic signature on a JSON Web Token (JWT), for example, allows an attacker to modify the token\u2019s contents and potentially impersonate other users or elevate their privileges.<\/li>\n<li><strong>Storing sensitive data without encryption:<\/strong> Persisting user passwords, personal information, or session tokens in a non-encrypted or weakly hashed format.<\/li>\n<\/ul>\n<p>A robust security posture demands strong, industry-standard encryption for all sensitive data, both in transit and at rest, coupled with a secure key management lifecycle.<\/p>\n<h3 id=\"a03-2021-injection\">A03:2021 Injection<\/h3>\n<p>Injection flaws are a broad class of vulnerabilities where an attacker can supply untrusted input to an application that is then relayed to an interpreter as part of a command or query. The core failure is the application\u2019s inability to separate untrusted user data from the intended command structure, allowing the interpreter to execute the malicious input.<\/p>\n<p>The most well-known example is <strong>SQL Injection (SQLi)<\/strong>. Consider an application that constructs a database query via string concatenation: <code>SELECT * FROM users WHERE username = '\" + userName + \"';<\/code>. If the application fails to sanitize the <code>userName<\/code> input, an attacker can submit a malicious payload like <code>' OR '1'='1<\/code>. The resulting query becomes <code>SELECT * FROM users WHERE username = '' OR '1'='1';<\/code>. The <code>OR '1'='1'<\/code> clause forces the <code>WHERE<\/code> condition to be true for every row, causing the database to return all users and effectively bypassing authentication.<\/p>\n<p>The definitive mitigation for SQLi is the use of <strong>parameterized queries<\/strong>, also known as prepared statements. This approach separates the query structure from the user-supplied data. The application first sends the query template with placeholders (e.g., <code>SELECT * FROM users WHERE username = ?;<\/code>) to the database engine. Then, it sends the user\u2019s input as a separate parameter. The database engine treats this input strictly as data and never as executable code, thus neutralizing the injection attack.<\/p>\n<p>While SQLi is common, injection is a broader problem that also includes <strong>Cross-Site Scripting (XSS)<\/strong>, where malicious scripts are injected into web pages and executed in victims\u2019 browsers, as well as injections into OS command interpreters, LDAP, or NoSQL databases.<\/p>\n<h3 id=\"a04-2021-insecure-design\">A04:2021 Insecure Design<\/h3>\n<p>Insecure Design is a broad category representing weaknesses that stem from a failure to incorporate security thinking into the application architecture from its inception. Unlike implementation bugs, these are flaws in the design itself, which can be costly and difficult to remediate later in the development lifecycle.<\/p>\n<ul>\n<li>Lack of Threat Modeling. The core approach to investigating security of a design is by questioning design through a structured process of identifying potential threats and vulnerabilities. For example, suppose there is a \u201cpassword reset\u201d features which sends a reset link to the user\u2019s email. A secure design would require answering a secret question or sending a code to a trusted device <em>before<\/em> the email is even sent, otherwise the security of the account reduces to that of the email inbox. Indeed, many services do not bother with considering such threat to be meaningful, allowing phishing to flourish today.<\/li>\n<li>Flawed Business Logic. The application might function reliably, but the workflow itself might be exploitable. This sometimes happens to small e-shops: if the system checks the price only when you add an item to the cart, you might add it to a cart during the sale, and then still buy it at that price after the sale expires - allowing user to buy items at a lower, expired sale price.<\/li>\n<li>Not Planning for Security Controls. The application design has to account for the need for separation of privileges, rate limiting, or other security controls, early on. If an internal admin application is built with the assumptions that all administrators are equally trusted, it might be harder to introduce fine-grained control - and if a junior administrator\u2019s account is compromised, the attacker might gain full control of the entire system because the design never planned for different levels of administrative access.<\/li>\n<\/ul>\n<p>This is a pretty common class despite its genericity, which requires a mitigation that extends beyond technological means - the design of application has to \u201cshift left\u201d, moving security to the earliest possible point in the development lifecycle. Companies are obliged to define Secure Development Lifecycle in their strategic documents and integrate security practices like threat modeling and architecture reviews into every development stage, from initial idea to deployment and maintenance.<\/p>\n<p>For regular evaluation of new features and architectures, a common, relatively simple and effective way is to ask a number of question - according to a model abbreviated as STRIDE:<\/p>\n<ol>\n<li>Spoofing: can an attacker pretend to be another user?<\/li>\n<li>Tampering: can they modify data in transit or at rest?<\/li>\n<li>Repudiation: could a user deny having performed an action?<\/li>\n<li>Information Disclosure: can user access data it should not?<\/li>\n<li>Denial of Service: can user crash or disable the system for others?<\/li>\n<li>Elevation of Privilege: can a low-privilege user gain administrative rights?<\/li>\n<\/ol>\n<h3 id=\"a05-2021-security-misconfiguration\">A05:2021 Security Misconfiguration<\/h3>\n<p>The application might have the strongest walls, good code, and best alarm systems and observability, but if the front door is open because of a configuration mistake, none of that matters. In operations, when security settings are defined, implemented, or maintained incorrectly, it is often the result of using insecure defaults, leaving temporary configurations in place. This category of vulnerabilities is commonly said to be all about human errors and lack of attention to detail during setup and maintenance - but I would argue that sensible defaults and clear heuristic warnings within applications are paramount for mitigating such issues.<\/p>\n<ul>\n<li><strong>Default Credentials:<\/strong> Many systems, from network hardware to databases, ship with well-known default credentials (e.g., <code>admin\/admin<\/code>). Failing to change these immediately upon deployment provides an easy entry point for attackers.<\/li>\n<li><strong>Verbose Error Messages:<\/strong> Error pages that reveal excessive detail\u2014such as full stack traces, internal file paths, or database schema information\u2014can provide attackers with a roadmap of the system\u2019s internal architecture, aiding in further attacks.<\/li>\n<li><strong>Unnecessary Services:<\/strong> Exposing non-production features or running unnecessary services on a production server increases the attack surface, providing more potential vectors for compromise.<\/li>\n<li><strong>Improper Environment Separation:<\/strong> A classic misconfiguration is a web server configured to list the contents of directories. This can expose sensitive source code or configuration files (like <code>.git<\/code> directories). This often points to a deeper issue: a failure to use a hardened build and deployment process that ensures only necessary, sanitized artifacts are deployed to the production environment.<\/li>\n<\/ul>\n<h3 id=\"a06-2021-vulnerable-and-outdated-components\">A06:2021 Vulnerable and Outdated Components<\/h3>\n<p>Much like in real logistics, software delivery process has its own <em>supply chain<\/em> which you might not always be able to trust. Modern applications and server operating systems often involve hundreds of third-party components - packages, libraries and frameworks. It means the application inherits the security posture of every one of those components - and if a library you rely on, directly or indirectly, has a security flaw, the application will have that same flaw.<\/p>\n<p>A particularly huge example was a severe remote code execution (RCE) vulnerability found in Log4j, an extremely common Java logging library, exposing millions of applications to an injection vulnerability where an attacker could get a server to run their code simply by getting the application to log a malicious string. Truly catastrophic.<\/p>\n<p>To avoid being targeted, application developers and operators must maintain an inventory of critical components and control which components can be added and removed, and try to stay informed by subscribing to security bulletins. Lately, there has been a plethora of automated scanning tools to detect vulnerable components, either using means built into package managers of modern programming languages, or using commercial platforms for Software Composition Analysis (SCA) to automatically find vulnerable dependencies and even suggest fixes to them with automatically submitted pull requests.<\/p>\n<p>In addition, it is worth to have clarity on the process of testing and deploying updates when a vulnerability is announces by maintaining an internal patching policy. The goal is to apply security patches quickly while ensuring they do not break the application.<\/p>\n<h3 id=\"a07-2021-identification-and-authentication-failures\">A07:2021 Identification and Authentication Failures<\/h3>\n<p>Authentication is the process of verifying the identity of a user or system. When authentication mechanisms are weak or broken, the entire security architecture of the application is compromised. The failures in this category historically were called \u201cBroken Authentication\u201d and include anything from compromised passwords to issues with multi-factor authentication.<\/p>\n<ul>\n<li><strong>Weak Password Policies:<\/strong> Allowing or requiring weak passwords, such as \u201cpassword123\u201d or \u201cadmin\u201d, makes accounts vulnerable to brute-force attacks or dictionary attacks.<\/li>\n<li><strong>Credential Stuffing:<\/strong> This occurs when users reuse passwords across multiple services. If one service is compromised, attackers can use the leaked credentials to access other services.<\/li>\n<li><strong>Session Management Issues:<\/strong> Improper session handling can lead to session hijacking, where an attacker can steal or predict a user\u2019s session token and impersonate them.<\/li>\n<li><strong>Insecure Password Recovery:<\/strong> Weak password reset mechanisms that rely on predictable questions or email confirmation without proper verification can be exploited.<\/li>\n<li><strong>Multi-Factor Authentication (MFA) Bypass:<\/strong> Flaws in MFA implementation can allow attackers to bypass the additional security layer, such as accepting SMS codes that were never sent or allowing users to skip MFA under certain conditions.<\/li>\n<\/ul>\n<p>Strong authentication mechanisms include implementing robust password policies, using multi-factor authentication, protecting against brute-force attacks through rate limiting, and ensuring secure session management with proper timeout and invalidation procedures.<\/p>\n<h3 id=\"a08-2021-software-and-data-integrity-failures\">A08:2021 Software and Data Integrity Failures<\/h3>\n<p>This category addresses failures in code and infrastructure that do not protect against integrity violations. This includes scenarios where an application relies on plugins, libraries, or modules from untrusted sources, repositories, and content delivery networks (CDNs) without proper verification.<\/p>\n<ul>\n<li><strong>Unsigned or Improperly Signed Code:<\/strong> Applications that automatically update from untrusted sources without verifying the integrity of the code can be compromised. For example, if a JavaScript library is served from a CDN without proper integrity checks, an attacker who compromises the CDN can inject malicious code into the application.<\/li>\n<li><strong>Insecure CI\/CD Pipelines:<\/strong> Compromised build and deployment pipelines can inject malicious code into applications. This is particularly dangerous because the malicious code appears to come from a trusted source.<\/li>\n<li><strong>Deserialisation Vulnerabilities:<\/strong> Applications that deserialize untrusted data without proper validation can execute arbitrary code. This is particularly common in languages like Java and Python, where serialized objects can contain executable code.<\/li>\n<\/ul>\n<p>To mitigate these risks, applications should verify the integrity of all code and data, use secure CI\/CD pipelines with proper access controls, and avoid deserializing untrusted data without proper validation.<\/p>\n<h3 id=\"a09-2021-security-logging-and-monitoring-failures\">A09:2021 Security Logging and Monitoring Failures<\/h3>\n<p>Security logging and monitoring is crucial for detecting and responding to security incidents. However, many applications have insufficient logging, making it difficult to detect breaches or understand the scope of an incident.<\/p>\n<ul>\n<li><strong>Insufficient Logging:<\/strong> Applications that don\u2019t log security-relevant events, such as login attempts, access control failures, or data access, make it difficult to detect attacks or investigate incidents.<\/li>\n<li><strong>Logs Not Monitored:<\/strong> Even if logs are generated, they must be actively monitored. Logs that are generated but never reviewed are of little value.<\/li>\n<li><strong>Ineffective Incident Response:<\/strong> Without proper logging and monitoring, organizations cannot effectively respond to security incidents, leading to prolonged exposure and greater damage.<\/li>\n<\/ul>\n<p>Effective security logging should capture all security-relevant events, be tamper-resistant, and be actively monitored. Organizations should have incident response procedures in place and regular testing of their detection and response capabilities.<\/p>\n<h3 id=\"a10-2021-server-side-request-forgery-ssrf\">A10:2021 Server-Side Request Forgery (SSRF)<\/h3>\n<p>Server-Side Request Forgery (SSRF) vulnerabilities occur when a web application fetches resources from URLs provided by users without proper validation. This allows attackers to force the server to make requests to unintended destinations, potentially exposing internal systems or services that are not directly accessible from the internet.<\/p>\n<ul>\n<li><strong>Internal Network Scanning:<\/strong> Attackers can use SSRF to scan internal networks and discover services that are not exposed to the internet.<\/li>\n<li><strong>Accessing Internal Services:<\/strong> SSRF can be used to access internal services like databases, admin panels, or cloud metadata services that assume trust from internal requests.<\/li>\n<li><strong>Cloud Metadata Exploitation:<\/strong> In cloud environments, SSRF can be used to access metadata services that provide sensitive information like access keys or instance details.<\/li>\n<\/ul>\n<p>To prevent SSRF vulnerabilities, applications should validate and sanitize all URLs before making requests, use allowlists for permitted domains, and implement network segmentation to limit the impact of successful attacks.<\/p>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>These fundamentals provide a foundation for understanding information security, but they are just the beginning. The field is continuously evolving, with new threats and vulnerabilities emerging regularly. Staying informed about current threats, best practices, and new technologies is essential for maintaining a strong security posture.<\/p>\n<p>The key to effective information security is not just understanding these concepts, but applying them systematically throughout the development and deployment lifecycle. Security is not a one-time consideration but an ongoing process that requires continuous attention and improvement.<\/p>\n"},{"title":"The War for the Web","pubDate":"Fri, 20 Jun 2025 00:00:00 +0000","author":"Hex","link":"https:\/\/0x484558.dev\/blog\/web-at-war\/","guid":"https:\/\/0x484558.dev\/blog\/web-at-war\/","description":"<p>The modern web has become a battlefield where fundamentally different philosophies about software architecture compete for dominance. Each approach represents not just technical choices, but entire worldviews about complexity, performance, and what the web should be.<\/p>\n<p>Traditional web development follows several well-established patterns:<\/p>\n<ul>\n<li><strong>Dynamic sites<\/strong> query databases and render HTML on each request<\/li>\n<li><strong>Static site generators<\/strong> pre-build HTML files that get served directly<\/li>\n<li><strong>Client-side applications<\/strong> fetch content via APIs and render it in the browser<\/li>\n<\/ul>\n<p>But beneath these surface patterns lies a deeper conflict about the nature of web development itself.<\/p>\n<h2 id=\"the-web-s-battleground\">The Web\u2019s Battleground<\/h2>\n<p>To understand the current state of web development, we need to examine the larger conflict reshaping how we build for the web. Three competing philosophies vie for dominance:<\/p>\n<ul>\n<li>\n<p><strong>The Empire of JavaScript<\/strong>: The entrenched regime backed by \u201cRESTful\u201d JSON APIs. React, Vue, Angular. Thick clients that treat the browser as an application runtime and manipulate the DOM, with or without the Shadow DOM. An ecosystem of staggering complexity, built on mountains of npm packages, baroque build tools, and a new state management library every Tuesday. It\u2019s a world where \u201cRESTful\u201d means shipping megabytes of client-side code to fetch JSON objects, a grotesque parody where the server becomes a data layer, the frontend becomes a complex state machine, and the network becomes a high-latency bus between them. This is what most people call \u201cmodern web development\u201d - and this empire, ruled by React, promises application-like experiences but mostly delivers churn, complexity, and abysmal performance.<\/p>\n<\/li>\n<li>\n<p><strong>The Hypermedia Reformation<\/strong>: The righteous rebellion of HTMX. <a rel=\"noopener nofollow noreferrer external\" target=\"_blank\" href=\"https:\/\/htmx.org\/essays\/how-did-rest-come-to-mean-the-opposite-of-rest\/\">As Carson Gross argues<\/a>, the JavaScript Empire has forgotten what made the web work. HTMX is a return to sanity, a declaration that you can have rich interactivity without drowning in client-side state. This movement represents a direct and necessary assault on the incidental complexity that the Empire normalized - by returning to <em>delivering documents<\/em>.<\/p>\n<\/li>\n<li>\n<p><strong>The Compiled Frontier<\/strong>: The parallel rebellion of WebAssembly. This path appeals to those who believe in performance, type safety, and engineering discipline. WebAssembly isn\u2019t just for running games or CAD software in a browser; it offers a complete escape route from the chaos of the JavaScript ecosystem. This approach sees the browser not as a JavaScript runtime, but as a universal, sandboxed compilation target - a means to an end of <em>delivering code<\/em> over the network.<\/p>\n<\/li>\n<\/ul>\n<p>Both HTMX and WebAssembly represent movements of dissent against the same broken status quo. I acknowledge the efforts of both equally, but personally salute the Reformation\u2019s diagnosis of the problem, which offers a meaningful path forward that goes beyond supplying tools to extract money from venture capital. The HTMX community\u2019s celebrated <a rel=\"noopener nofollow noreferrer external\" target=\"_blank\" href=\"https:\/\/htmx.org\/essays\/a-real-world-wasm-to-htmx-port\/\">port of a WASM app<\/a> wasn\u2019t a victory for HTML over compiled code; it was a victory for simplicity over the kind of needless Rube Goldberg complexity the JavaScript Empire taught us was normal.<\/p>\n<p>The point is - <em>we agree on the enemy<\/em>. The question is not \u201cwhich is less complex,\u201d but \u201cwhat kind of complexity are you willing to accept?\u201d The Empire\u2019s complexity is accidental, meaningless, and serves only to feed the churn. The complexity of the rebellions is deliberate and purposeful.<\/p>\n<ul>\n<li><strong>HTMX chooses the complexity of the server<\/strong>. It asks you to manage state, templates, and routing on the backend, in exchange for radical simplicity on the frontend. It is a bet on the robustness of server-side logic and the enduring power of HTML.<\/li>\n<li><strong>WebAssembly chooses the complexity of the toolchain<\/strong>. It asks you to accept compile times, binary sizes and low-level complexity in exchange for potentially escaping the JavaScript sandbox and DOM entirely, allowing you to write sophisticated software in a truly OS-independent and standardized bytecode format. It is a bet on performance, portability, and the power of compiled languages delivered by an unsophisticated server-side logic.<\/li>\n<\/ul>\n<p>Neither is wrong. They are two different fronts in the same war. HTMX is fighting a guerrilla war from the hills, using the enemy\u2019s own infrastructure against them. WebAssembly is opening a new front across the sea, with new weapons and a new philosophy of combat.<\/p>\n<h2 id=\"the-webassembly-philosophy\">The WebAssembly Philosophy<\/h2>\n<p>To appreciate what makes the WebAssembly approach novel, a brief historical parallel is illuminating.<\/p>\n<p>JavaServer Pages (JSP) pioneered the idea of compiling markup into executable code - transforming <code>.jsp<\/code> files into Java servlets that could generate HTML. Each JSP page became a compiled class, with HTML templates converted into print statements and dynamic content woven through Java code. This compilation approach offered performance benefits and type safety, but at the cost of mixing presentation with business logic.<\/p>\n<p>WebAssembly takes this compilation concept and inverts it: instead of server-side compilation producing HTML on every request, we have build-time compilation that can contain view logic and render once in the browser. Where JSP compiled templates into bytecode that ran on the JVM to produce markup repeatedly on each request, WebAssembly applications compile content and view logic into bytecode at build time that runs in the browser to produce markup on demand. It\u2019s a return to treating content as code, but now the compilation target is the browser itself.<\/p>\n<p>Consider a blog built with this approach: when visitors navigate to the site, their browser downloads a WebAssembly module (plus minimal JavaScript glue code). Inside that binary, alongside frameworks like <a rel=\"noopener nofollow noreferrer external\" target=\"_blank\" href=\"https:\/\/leptos.dev\/\">Leptos<\/a> and routing logic, can live the compiled view functions for every blog post. This isn\u2019t just a technical curiosity - it\u2019s a statement about what single-page applications could be. Yes, such applications are SPAs. But unlike the JavaScript Empire\u2019s SPAs that ship megabytes of interpreted code and runtime dependencies, these ship optimized binary payloads. The difference isn\u2019t in the user experience; it\u2019s in the engineering discipline required to create them.<\/p>\n<p>JSP moved templating complexity into compiled server code. The JavaScript Empire moved it into client-side state management. HTMX moves it back to the server but keeps it simple. WebAssembly says: if we\u2019re going to have complexity, let\u2019s at least have the benefits of a real compiler and type system.<\/p>\n<p>This represents just one of many possible solutions to the tension between seeing the web as a document platform or an application platform. The industry has spent decades pretending otherwise, layering application logic on top of document semantics until the original intent became unrecognizable. WebAssembly represents a possibility for philosophical reconciliation. The technology declares: \u201cLet\u2019s stop pretending. The web is an application platform\u201d - and brings the full power of desktop applications to the web. Consider WebGPU, which brings near-native graphics performance to the web (currently shipping in Chromium-based browsers), and the emerging WebNN, which will allow running machine learning and artificial intelligence using on-device resources, in the browser.<\/p>\n<p>And yet, paradoxically, WebAssembly can be used to deliver what the web was originally designed for - hypertext documents. The circle becomes complete: using the web\u2019s most advanced application delivery mechanism to serve traditional content.<\/p>\n<h2 id=\"the-trade-offs\">The Trade-offs<\/h2>\n<p>When search engine bots visit a pure WASM-powered site, they might find an empty shell:<\/p>\n<pre class=\"giallo\" style=\"color: #E1E4E8; background-color: #24292E;\"><code data-lang=\"html\"><span class=\"giallo-l\"><span>&lt;!<\/span><span style=\"color: #85E89D;\">DOCTYPE<\/span><span style=\"color: #B392F0;\"> html<\/span><span>&gt;<\/span><\/span>\n<span class=\"giallo-l\"><span>&lt;<\/span><span style=\"color: #85E89D;\">meta<\/span><span style=\"color: #B392F0;\"> charset<\/span><span>=<\/span><span style=\"color: #9ECBFF;\">&quot;UTF-8&quot;<\/span><span> \/&gt;<\/span><\/span>\n<span class=\"giallo-l\"><span>&lt;<\/span><span style=\"color: #85E89D;\">meta<\/span><span style=\"color: #B392F0;\"> name<\/span><span>=<\/span><span style=\"color: #9ECBFF;\">&quot;viewport&quot;<\/span><span style=\"color: #B392F0;\"> content<\/span><span>=<\/span><span style=\"color: #9ECBFF;\">&quot;width=device-width, initial-scale=1.0&quot;<\/span><span> \/&gt;<\/span><\/span>\n<span class=\"giallo-l\"><span>&lt;<\/span><span style=\"color: #85E89D;\">link<\/span><span style=\"color: #B392F0;\"> rel<\/span><span>=<\/span><span style=\"color: #9ECBFF;\">&quot;stylesheet&quot;<\/span><span style=\"color: #B392F0;\"> href<\/span><span>=<\/span><span style=\"color: #9ECBFF;\">&quot;...&quot;<\/span><span>\/&gt;<\/span><\/span>\n<span class=\"giallo-l\"><span>&lt;<\/span><span style=\"color: #85E89D;\">title<\/span><span>&gt;...&lt;\/<\/span><span style=\"color: #85E89D;\">title<\/span><span>&gt;<\/span><\/span>\n<span class=\"giallo-l\"><span>&lt;<\/span><span style=\"color: #85E89D;\">body<\/span><span>&gt;&lt;\/<\/span><span style=\"color: #85E89D;\">body<\/span><span>&gt;<\/span><\/span><\/code><\/pre>\n<p>Yes, this approach can violate \u201cview source\u201d transparency. But here\u2019s the thing: so does every React app with <code>&lt;div id=\"root\"&gt;<\/code>-ridden DOM. The difference is that WebAssembly is honest about the trade-off. This architecture chooses compilation over interpretation, accepting the trade-offs explicitly rather than pretending that generated <code>&lt;div class=\"css-1a2b3c\"&gt;<\/code> soup is semantic HTML.<\/p>\n<p>For SEO-critical applications, WebAssembly developers can employ server-side rendering (SSR) or static pre-rendering to generate indexable HTML snapshots. Tools like Leptos support SSR out of the box, allowing the same Rust code to render on both server and client. This hybrid approach delivers crawlable content for search engines while maintaining the performance benefits of client-side WebAssembly.<\/p>\n<p>Many successful projects have implemented exactly such hybrid approaches. The build system generates static HTML files for each piece of content alongside the interactive WebAssembly application, creating a dual-delivery mechanism that serves both human readers and search engine crawlers. When you visit a content URL, search engines receive a fully-rendered HTML page with complete content, proper meta tags, and structured data, while human browsers can be transparently redirected to the interactive WebAssembly version. This architecture preserves the philosophical purity of the compiled approach - the WebAssembly application remains self-contained and carries its own content - while pragmatically acknowledging the realities of web discoverability.<\/p>\n<p>Each architectural choice carries real costs in practice:<\/p>\n<p><strong>HTMX<\/strong>:<\/p>\n<ul>\n<li><strong>Wins<\/strong>: ~14KB library (min+gzip), progressive enhancement, SEO-friendly by default, works without JavaScript<\/li>\n<li><strong>Costs<\/strong>: Server state management, websocket complexity for real-time features, careful API design<\/li>\n<li><strong>Choose when<\/strong>: Building content-heavy sites, e-commerce, anything where SEO matters, teams with strong backend expertise<\/li>\n<\/ul>\n<p><strong>WebAssembly<\/strong>:<\/p>\n<ul>\n<li><strong>Wins<\/strong>: Type safety, near-native performance, true offline capability, sophisticated client-side features<\/li>\n<li><strong>Costs<\/strong>: Baseline binary size, compile times, SEO requires pre-rendering, smaller talent pool<\/li>\n<li><strong>Choose when<\/strong>: Building actual applications (not sites), offline-first experiences, computation-heavy features, when you need to escape JavaScript\u2019s limitations<\/li>\n<\/ul>\n<p>But the real question isn\u2019t \u201cIs this overengineered?\u201d The question is \u201cWhat kind of engineering do you want to do?\u201d HTMX asks you to engineer your server. WebAssembly asks you to engineer your build pipeline. The JavaScript Empire asks you to engineer around its decadency.<\/p>\n<h2 id=\"looking-forward\">Looking Forward<\/h2>\n<p>So where does this leave us? In a battle between two honest rebellions and one dishonest empire.<\/p>\n<ul>\n<li>HTMX is honest. The framework embraces the web\u2019s document-oriented nature and extends it.<\/li>\n<li>WebAssembly is honest. The technology embraces the web\u2019s application-runtime nature and extends it.<\/li>\n<li>The JavaScript Empire is dishonest. This ecosystem pretends to embrace the document model while reducing HTML to a meaningless delivery vehicle for its bloated client-side machinery. The approach pays lip service to web standards while violating their spirit.<\/li>\n<\/ul>\n<p>But honesty alone doesn\u2019t ship products. Here\u2019s your practical path forward:<\/p>\n<p><strong>If you\u2019re starting fresh:<\/strong><\/p>\n<ol>\n<li><strong>Default to HTMX<\/strong> for anything content-focused. It\u2019s not just simpler; it\u2019s more correct for 80% of web projects.<\/li>\n<li><strong>Consider WebAssembly<\/strong> when you have actual application requirements: offline-first, heavy computation, or when you need guarantees that JavaScript can\u2019t provide.<\/li>\n<li><strong>Avoid the Empire<\/strong> unless you have a specific technical requirement that only its ecosystem can satisfy.<\/li>\n<\/ol>\n<p><strong>If you\u2019re already in the Empire:<\/strong><\/p>\n<ol>\n<li><strong>Stop adding complexity<\/strong>. No new state management libraries. No new build tool chains. No new abstractions.<\/li>\n<li><strong>Start extracting<\/strong>. Move pages that don\u2019t need client state to server-rendered alternatives. You don\u2019t have to rewrite everything.<\/li>\n<li><strong>Measure ruthlessly<\/strong>. Bundle size, time-to-interactive, memory usage. Let data drive your migration.<\/li>\n<\/ol>\n<p><strong>For the adventurous:<\/strong><\/p>\n<ol>\n<li><strong>Experiment with hybrid approaches<\/strong>. HTMX for your content, WebAssembly for your apps.<\/li>\n<li><strong>Contribute to the rebellions<\/strong>. Both movements need better tooling, documentation, and real-world examples.<\/li>\n<li><strong>Share your war stories<\/strong>. Every migration from the Empire strengthens the rebellion.<\/li>\n<\/ol>\n<p>The future of the web won\u2019t be won by a single victor. It will be won by developers who choose architectures that match their actual requirements rather than their tribal affiliations. Choose your complexity wisely, engineer deliberately. But whatever you do, stop pretending that <code>&lt;div&gt;<\/code>-ridden HTML is somehow \u201csemantic\u201d.<\/p>\n"}]}}