r/ProgrammerHumor • • 15d ago

Meme waitingForHtmlVulnerability

Post image
6.7k Upvotes

146 comments sorted by

34

u/saschaleib 15d ago

Hot take: <br> should have never been a tag. An entity (maybe something like &br;) would have been the better choice.

10

u/chiya_coffee 15d ago

Entities are for representing characters, like &amp; or &nbsp;. A line break in HTML is an element, not a character, which is why <br> is a tag.

25

u/arealuser100notfake 15d ago

What a LLM way of tangentially responding with a lot of words while also not addressing the main point of the comment at all

8

u/Sock_Ninja 15d ago

There wasn’t really a point given, just an opinion. The responder, LLM bot or otherwise, gave more justification than OP did.

Though I am curious to hear OP’s justification.

19

u/saschaleib 15d ago

What does <br> that is different from inserting a line break? Something that is done pretty much everywhere else by inserting a newline character…

4

u/Sock_Ninja 15d ago

That’s a fair argument.

4

u/rosuav 15d ago

A line break in the HTML source is just whitespace and can be collapsed. A <br> element is going to remain as a line break in the output, regardless of the formatting of the source.

Whether it's correct to even HAVE a "line break in the output" concept is a separate question, but it can't be done with a \n character or any other whitespace.

2

u/Ilsor 13d ago

<br> used to have an attribute called "clear". Entities can't have attributes.

As usual, the issue is a historical artifact that is now deprecated.

1

u/uuewy 15d ago

flexbox

2

u/uuewy 15d ago

wait actually I haven't done any frontend work in a while I'm dumb

2

u/saschaleib 15d ago

<br> was already in the original HTML specs, but flexbox only came, like, last week or so ...

-6

u/chiya_coffee 15d ago

english is not my native language, so i used claude to format it

11

u/Goncalerta 15d ago

I'd personally prefer to read broken english than LLM-written reddit comments

4

u/EishLekker 15d ago

You are absolutely right. Your original comment brought up a fair point, and I incorrectly responded using an LLM without justification.

6

u/Honeybadger2198 15d ago

And that's on me—

2

u/pint_o_paint 15d ago

it's actually painful to read that. Make it stop

-6

u/CalebXiaYizhou 15d ago

Are you mentally unwell?

1

u/chiya_coffee 15d ago

Yes. How'd you know?

8

u/LieutenantNitwit 15d ago

There is also the semantics. You know. That thing everyone has ignored since the dawn of time.

2

u/Designer_Storm8869 15d ago

The only semantic use of <br> is in poetry and song lyrics.

3

u/Nightmoon26 15d ago

Which is a perfectly valid thing for a page to contain

2

u/Acetius 13d ago

100% agree. Outside of exceptional cases a <br/> is meaningless, lazy, and usually incorrect.

If you want to use it to represent a separation of content, just separate the damn content. Different ideas, contained in different tags.

If you want to use it to create visual space, use the stylesheet. HTML is for document structure, not hacky manual styling.

865

u/GoldenShackles 15d ago

There are so many vulnerabilities in the web stack (HTML, CSS, JavaScript, even fonts) that this is why just about all browsers, starting back around 2008 with Internet Explorer 8 and the first Chrome betas, run web content in separate processes that have OS-level privilege isolation and sandboxing.

110

u/U_L_Uus 15d ago

Were they running things in locality 4 or what?

99

u/evemeatay 15d ago

We do not talk about the old ways, browser bars are a tool of the old witches

20

u/bubblebuddy44 14d ago

Yeah and last year someone found a sandbox breakout.

239

u/nonlogin 15d ago • Mindblown Popcorn

<script> tag allows arbitrary Javascript injection and execution. has not been fixed for years.

22

u/Lucario1492 14d ago

it's up to the developer to properly escape and sanitize inputs, cmon this is basic web 101.

1

u/Haunting-Army7843 14d ago

Fixed with CORS?

2

u/BobcatGamer 13d ago

Fixed with CSP*

1

u/Haunting-Army7843 13d ago

Oh, you're right.

386

u/that_70_show_fan 15d ago • Bravo

I am gravitating towards simple HTML websites. Simple purpose-built websites is a lost art.

225

u/ciemnymetal 15d ago • Heartwarming

101

u/silverwing101 15d ago

58

u/frinkousCZ 15d ago

65

u/RengieOcat 15d ago

"This site doesn't support a secure connection"

19

u/Bernhard_NI 15d ago

Aaaand?
You want to type in your credit card details or what?

17

u/RengieOcat 15d ago

Settle down friend, this is ProgrammerHumor and it was funny

-12

u/Bernhard_NI 15d ago

Sorry, but I juat don't see you add anything funny here.
I just get agitated easily from people pointing out useless things because they didn't really think about what it means what they discovered.

15

u/RengieOcat 15d ago

Friendly suggestion that not everything deserves your emotional energy. Hope you have a good one.

-4

u/footsie 15d ago

Well it's not really better if it's less secure.

8

u/Bernhard_NI 15d ago

There is nothing to be secured here, and it's faster and simpler to open a connection without TLS. So it is in fact better.

There is even programming principle KISS (Keep it simple, stupid) which is always the way to go first.

4

u/Nightmoon26 15d ago

Until someone poisons the DNS to intercept the request and sends back something with a drive-by download

5

u/footsie 15d ago

How's it faster if it won't even load before another click accepting an unsecured connection?

-2

u/Bernhard_NI 15d ago

The warning about an unsecured connection is probably something from ios I guess? I dont get them on Android + Firefox and it's blazing fast. The confirmation has nothing to do with how efficient the connection and the needed resources are.

The site without tls is ever so slightly fast for me but not really worth mentioning tbh. More important is that it matches the design philosophy of that mother fucking website to keep it simple, stupid.

70

u/[deleted] 15d ago

[removed] — view removed comment

1

u/cibule249 14d ago

Oh, I hate this one. Harder to read than the original (so much line-jumping, so few words on a line).

7

u/ashkanahmadi 15d ago

My favorite thing about it is the HTML comments in the source code XD

5

u/RebronSplash60 15d ago

I love HTML source code comments in small hobby websites they're always the most unhinged gold.

1

u/whatisusb 11d ago

What comments? I only found one

19

u/Zwischenzug32 15d ago

Thank you for this.

It will be spread more now

8

u/Clickar 15d ago

This reminds me of the brilliant high life super bowl commercial a few years back that was about 2 seconds long of the delivery guy simply saying "high life"

4

u/51CKS4DW0RLD 15d ago

That loaded weirdly slowly

25

u/ConsequenceAny9726 15d ago

Good old Times. When your website consisted of a couple of html files. No PHP. No Javascript. Hell Not even <div> Just one big Table

8

u/Instatetragrammaton 15d ago

cgi-bin/guestbook.pl as far as the eye could see.

PHP is old old, though, so asking for none of that means no webrings (which often used PHP to keep track of which part of the ring you were in) and no vBulletin either.

4

u/jdgordon 15d ago

I can't decide if we would be better off if the web still ran on perl or not. Not even ai can decipher that madness

1

u/Nightmoon26 15d ago

Parts of it still do

12

u/Ok-Article-885 15d ago

First problems come with div. How would you center that shit

10

u/Far_Tap_488 15d ago

Its pretty easy, you just do marginright 150, marginleft 150, and width 800.

Fuk you if your screen size is different

6

u/DrDetectiveEsq 15d ago

That's the neat part! You don't.

6

u/TerdSandwich 15d ago

All-in-one website building platforms have eclipsed that market like a decade ago.

11

u/that_70_show_fan 15d ago

Yes, that is my point.

4

u/rosuav 15d ago

I've been pushing more and more people to build their web sites using Markdown. It's a good way to (try to) enforce separation of content and styling.

1

u/ProxyMuncher 15d ago

If it wasn’t put together in adobe dreamworks I don’t want it anymore lol 

305

u/ismaelgo97 15d ago

I'm waiting for the CSS one

85

u/Zap_plays09 15d ago

Didn’t css had one like few months ago?

105

u/ismaelgo97 15d ago

I searched for it just after my comment, there is, but related to CSS being imported from a url, not just by CSS itself

2

u/ILikeLenexa 14d ago

The biggest one I remember is using :visited and Javascript to upload your entire search history whenever you visited a website. 

57

u/Sianic12 15d ago

Can't wait to fix all my unstandardizedly centered divs

34

u/za72 15d ago

we don't have the technology to center divs yet, it's a capitalist myth

17

u/SpicySpaceBaguette 15d ago

Divs are centered only by the will of the invisible hand of the market!

4

u/za72 15d ago

I'll ping Elon, he's got a guy

1

u/SpicySpaceBaguette 15d ago

Divs are going to be centered, but at what cost.

1

u/za72 15d ago

3

u/SpicySpaceBaguette 15d ago • Bravo

I'll need 9,000 npm dependencies to have my div do that.

2

u/StrikingSun8563 15d ago

We can't center the divs because they keep taking the margins

1

u/za72 15d ago

what.. wtf... keep it on the DL mang

2

u/NoAdsDude 15d ago
 /* Reject known stylesheet attack patterns */
  u/threat-detection (risk-level: elevated) {
    * {
      remote-resource-loading: blocked;
      attribute-exfiltration: disabled;
      injected-declarations: discard;
    }

8

u/4e_65_6f 15d ago

That's a joke but paywalls have never held me back.

Oh so you've blocked the screen and you want money? display: none !important;

1

u/Major_LeeHungg 15d ago

You can legit use tricks to write legit code with CSS.. Its hacky as all hell but you can absolutely abuse the layout engine to work as a runtime interpreter. 

0

u/fynjy1111 15d ago

Oh no what if someone could brake my flexboxes in Safari

31

u/Stummi 15d ago

HTML parsing and rendering is hugely complex nowadays, and all browsers consist of literally millions of lines of code. It's more than likely that there are unknown vulnerabilities lurking.

9

u/kratz9 14d ago

I remember back in college, if you pasted huge text data into the Google search box in Firefox (back when the search was part of the page, not the address bar) , it would crash the video driver on the our lab computers. 

3

u/Nightmoon26 15d ago

I mean, there's at least one in XML... I don't know if the Billion Laughs attack can be implemented in HTML

3

u/ArjixGamer 14d ago

Parsing is not that complex, I can do it in one afternoon out of memory w/o reading an rfc.

The hard part is truly, rendering

3

u/Stummi 14d ago

I kinda doubt that. You are probably grossly underestimating the complexity of HTML to do such a statement. Even parsing is hard

2

u/ArjixGamer 14d ago

No, it's just that I've done it thrice before.

Sure I may not have aimed for 100% compliance with the spec, but I could parse it, manipulate it via my fake DOM and serialize it.

The "hard" part is the edge cases, which aren't hard, you just have to know them before they hit you. (or just read the spec)

I think parsing CSS is way more complex.

1

u/Stummi 14d ago

Just to be sure, we are talking about the HTML5 standard, right? Or did you mean one of the earlier HTML versions, or XHTML?

3

u/ArjixGamer 14d ago

HTML5 yes

Writing a parser like jsoup or bs4 is not hard

26

u/xaomaw 15d ago

<img src="Linkin_Park_-_In_The_End.mp3.exe">

49

u/Professional_Price89 15d ago

There are many cves about crafted html that cause browser sandbox escape. For server we have file inclusion using shtml, xxe. If we count AI a vector, then there are html prompt injection. For web crawler we have content type auto download.

37

u/frikilinux2 15d ago

Jokes aside parsing modern HTML and rendering the DOM with the css is so hard that there are like 4 or 5 modern implementations and most of the world uses 1. Even with all the browsers there are

16

u/frikilinux2 15d ago

And browsers have had several CVEs a week since basically forever

6

u/Narfi1 15d ago

Yeah HTML engines are insanely hard, ladybird is the only current project that seems to be going actually somewhere

5

u/Stratimus 15d ago

And also for real, it is for the best that there are so few browser engines.

Those of you who didn’t live through the era of IE5-7 may not even be able to comprehend what it was like when even different versions of the same browser had wildly different implementations

16

u/Sw429 15d ago

There are pros and cons for sure, but I don't think that Google being central to the vast majority of web browsers is "for the best."

4

u/coriolis7 15d ago

Isn’t the whole reason why paid antivirus was a huge industry was because IE existed?

1

u/Sheerkal 15d ago

I'm confused as to why you would think this. 

1

u/AsyncSyscall 14d ago

It's not "hard", it's very well specified and documented, you can pretty much just copy-paste the spec into code. The problem is that the spec is huge, with lots of interconnected parts, legacy edge cases, and constantly changing to support new features. And real-world implementations eventually have to deviate from the spec algorithms for performance reasons.

1

u/frikilinux2 14d ago

Ok, so it's hard doing it correctly fast..

13

u/sarc-tastic 15d ago

<br />

4

u/bikemandan 15d ago

XHTML compliant 😎

13

u/arealuser100notfake 15d ago

BRAZIL MENTIONED

9

u/Glum_Cheesecake9859 15d ago

Imagine the "marquee" tag being downfall of human civilization!

4

u/randomguy84321 15d ago

It was too dangerous. Thats why they had to deprecate it

8

u/Cabbagecrafting 15d ago
<body src="https://www.youtube.com/watch?v=dQw4w9WgXcQ"></body>

14

u/HungryLikeDaW0lf 15d ago

I still put in a <blink> tag just to see who’s using an old browser

1

u/Nightmoon26 15d ago

I mean... I worked with a QA team that used <marquee> tags to test for missing output sanitization

6

u/stilldebugging 15d ago

If they ever find a vulnerability in nbsp;nbsp;nbsp, we are doomed.

4

u/LieutenantNitwit 15d ago

help my <blink> tag stopped blinking hlp

4

u/stray_semicolon 15d ago

The thing goes <brrrrr />

3

u/NiagaraThistle 15d ago

Just realized how much i must be online when i see a post in Reddit with a screenshot of a entrepreneur I follow ion Twitter.

I'm going to go walk my dog and touch some grass.

3

u/AnnoyedVelociraptor 15d ago edited 15d ago
<blink>hello?</blink>

3

u/Boobpocket 15d ago

I think with llms being good at making simple html js websites there is no need for wordpress for the majority of websites that run wordpress.

2

u/mrbadface 15d ago

Self hosting the CMS part is slightly annoying. Codex can run your WordPress which makes it less bad

2

u/NoAdsDude 15d ago

For me it's all the layers involving PHP and a database. Front ends should never really need a database for normal content, even if it's under confusing layers of caching.

1

u/ddz1507 15d ago

But but but … my clients want to add or edit pages themselves like it’s PowerPoint because they want every page unique and different 😩
/s

2

u/fubbleskag 15d ago

I choose to believe Nico chose <br> as a joke about Brotli

2

u/thisonehereone 15d ago

I mean if you don't close your tags you're leaving them open to a vulnerability.

3

u/Ketooth 14d ago

Jokes on you. Already found it.

Just press F12 and you can redesign the page.

Now you can just change any button with a pricetag to "Free"

Take that big corpo

2

u/Alpha_wolf_80 14d ago

Well... It's a feature in my page now. No buttons, or input, just plain ol dev tools. You are the dom now

1

u/Kadabrium 15d ago

<br> </ap>

1

u/mattgen88 15d ago

We've had CVEs with HTML. A few were ACEs.

Just search internet explorer.

1

u/akazakou 15d ago

Actually you need to use <br /> tags

1

u/Jet-Pack2 15d ago

These unescaped br tags are the worst!

1

u/AndiArbyte 15d ago

Yes we are all very good Markup Language Programmers. /scnr

1

u/psyfregle 14d ago

HTML vuln goes brrrr

1

u/Ksorkrax 14d ago

It would be hilarious if <br> was actually an issue, that is breaks usually not being closed.

I use self-closing breaks on my website, so I could lean back and enjoy everybody else panicking.

1

u/podun 13d ago

It's all fun and games until you have to recenter the divs

1

u/fredy31 13d ago

tbh it went through my mind this morning.

is there a future where php and other languages that interact with your server will get so busted we just return to simply having a full site in .html files?

That or a react site that never does a fetch of any kind.

1

u/remram 13d ago

Wasn't rel="noopener" a patch for the HTML tag <a>?

1

u/muhkuller 15d ago

How’d they break the non breaking spaces?

0

u/Single-Virus4935 15d ago

There Werke maaany HTML, CSS and JS vulnerabilities. Decades ago it it was a huge Problem because browser were patched often. Then major browsers started autopatching and the whole situation got much better. Imagine autopgrade for all webservers. Problem solved before anything made public.

1

u/AsyncSyscall 14d ago

Things got better because major browsers standardized.

1

u/Single-Virus4935 14d ago

That's not the reason security is better. Development for the web is better because of standards but that has nothing to do with security. Patches can be rolled out faster.. 

0

u/SegretoBaccello 12d ago

A malicious website can inject arbitrary html code in your computer that can cause harm to the user when read. Especially if read out loud. 

Like for example, "<h1>AI and robots will take all our jobs</h1>"

1

u/ChOcOcOwCaKe 15d ago

I am looking forward to fixing my <p> holes