Show HN: Draw a fish and watch it swim with the others (opens in a new tab)drawafish.com
935 pointsMade this website as an exercise in vibe-coding and GCP. It was posted about a few times around the internet, on sites like Morning Brew (https://www.morningbrew.com/issues/business-buzzkill), MetaFilter (https://www.metafilter.com/209703/Draw-A-Fish), boingboing.net, etc. I think it's cute!
I built a basic CNN trained against penises and swastikas, and then anything that doesn't hit the 63% confidence score gets sent to a mod queue, a vibe-coded fish-tinder (https://bsky.app/profile/bigass.bsky.social/post/3luvikxn3f2...).
Was a fun exercise, spent about a month on it. Frontend is HTML5 hosted on github pages, backend is Node.JS on GCP.

Comments (234) 108 threads
Earlier commentsAt least on Firefox/Mac, sometimes while dragging it "picks up" the image to drag it. This should prevent that.
The code shows it... Your escaping routine seems OK, but you really __should not__ be building HTML and JS(!) using raw string interpolation. Or letting the client decide whether the submission needs moderation.
There's a very slightly different model in the backend that sends things to the mod queue. Strings are also sanitized there. But copilot really wanted to add all that logic to the frontend too and I thought it was funny
(jk)
This is definitely a drawback with with vibe-coding. I never really write like HTML5 style code - at work I always use typescript with heavy ESLint, so never have to worry about this.
I figured the string sanitization in the backend would take care of any XSS vulns, which was my main concern. But I will have to read into the dangers of string interpolation which I admit I do not remember too much about (outside of the XSS stuff I tried to mitigate).
Thanks for giving the opportunity to learn... :)
Continue this thread — 1 reply
When you set element.textContent = someUserGeneratedContent, the browser guarantees that the user-generated content will never be parsed as HTML.
response.write("" + sanitize(someUserGeneratedContent) + "") has no such guarantee.
They have it in several other places.
All comments shown.
Couldn't load more comments. Check your connection and try again.