this post was submitted on 24 Feb 2025
3 points (100.0% liked)

Technology

65819 readers
5194 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
top 44 comments
sorted by: hot top controversial new old
[–] undefined@lemmy.hogru.ch 2 points 2 weeks ago (3 children)

I’ve been doing web development for something like 20 years now and I just can’t imagine how shitty your backend is if this is an issue.

[–] Dasus@lemmy.world 1 points 2 weeks ago

With LLM coding increasing, it might be going up. Idk am no pro, just worried.

Tangential, but I find it hilarious how Gemini's syntax fucks up all the time.

I ask it to change my light called "CX2" to red. It complies, like usual, and it reads Okay, changing "CX2" to red., but what it says out loud is Okay, changing "CX two inches to red.

[–] timuchan@lemm.ee 1 points 2 weeks ago (1 children)

This was my thought as well, sanitize your inputs! Are they not quoting/casting to string before input?

[–] undefined@lemmy.hogru.ch 2 points 2 weeks ago (2 children)

Unless you’re coding from scratch it’s hard to not do this with any modern framework.

[–] limer@lemmy.dbzer0.com 2 points 2 weeks ago

Legacy systems still handle more traffic than modern ones, I’d wager

[–] limer@lemmy.dbzer0.com 1 points 2 weeks ago (1 children)

Word press code, and plugins, do not sanitize out of the box. You have to call an additional function, each time, that is not provided automatically. Many home made plugins miss that; many popular plugins used to be home made ones

[–] PixelTron@lemm.ee 1 points 2 weeks ago (1 children)

Wordpress is a sin against mankind.

[–] Atherel@lemmy.dbzer0.com 1 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

Let's take a blog and slap a whole e-commerce system on it through a plugin and let it auto translate with another one, what could go wrong. wait why is everything so slow, oh i need additional plugins for caching and one more for functionality XYZ why is everything broken now?!?

Edit: Sorry, my app had a hiccup and posted my comment several times

[–] narc0tic_bird@lemm.ee 1 points 2 weeks ago

Maybe your app is based on WordPress :'D

[–] livingcoder@programming.dev 1 points 2 weeks ago

It happened to a friend who wasn't passing in the proper types into their stored procedures, all strings, and "null" (not case sensitive) conflicted with actual null values. Everything in the web interface were strings, and so was null.

For some people it takes this mistake before they learn to always care about the data types you're passing in.

[–] recursiveInsurgent@lemm.ee 2 points 2 weeks ago (1 children)

I was NaN years old when I learned this.

[–] Scrollone@feddit.it 1 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

It's funny because I also learned on [Object object].

[–] sugar_in_your_tea@sh.itjust.works 1 points 1 week ago (1 children)

And here I am at undefined years old, learning for the first time.

[–] And009@lemmynsfw.com 1 points 1 week ago

I'm a year old undefined and I find it [redacted]

[–] futatorius@lemm.ee 1 points 1 week ago* (last edited 1 week ago)

There is an infosec guy in California who had NULL as his car license plate. If a license-plate reader detects a ticketable event but the license plate is unreadable, guess how the system handles those events?

Infosec guy was not a happy bunny.

[–] mysticpickle@lemmy.ca 1 points 1 week ago
[–] melroy@kbin.melroy.org 1 points 2 weeks ago

What about X Æ A-Xi? lol

[–] afronaut@lemmy.cafe 1 points 2 weeks ago (1 children)

Lmao, I knew a guy from grade school with the last name Null.

[–] Shardikprime@lemmy.world -1 points 1 week ago

Friend of little Bobby I presume

[–] ramble81@lemm.ee 1 points 2 weeks ago (1 children)

Knew a guy who had the license plate ‘NULL’ and he was telling me how he never got a toll bill or red light ticket.

[–] fahfahfahfah@lemmy.billiam.net 1 points 2 weeks ago (1 children)

The article talks about a guy with a “NULL” license plate who gets tons of tickets for things he didn’t do so probably not the best plan

[–] PM_Your_Nudes_Please@lemmy.world 1 points 2 weeks ago (1 children)

Yep. For the curious, any time a license plate photo couldn’t be fully read by the automated system, it was marked as “NULL” and he was flagged as the driver. So every single red light camera and speeding camera in the area was sending him to court every day.

[–] CheeseNoodle@lemmy.world 1 points 2 weeks ago (2 children)

It got worse than this, the ticketing company really wanted to get the money from him so when he got hold of a copy of the records and pointed out that one ticket was for a completely different car they modified the records on their end to change the make of car so it would match his. iirc he only got out of it because he had paper copies.

[–] Takios@discuss.tchncs.de 1 points 2 weeks ago (1 children)

Don't they have to prove it with a photograph? In GermanyI'd laugh in theirface withput a photograph as evidence.

Hey AI can you swap this 2015 corolla with a green 2019 Mazda 2.

Keep the license plate the same!

And remember THERE ARE FOUR PASSENGER DOORS NOT 6

[–] DemonVisual@lemm.ee 1 points 2 weeks ago

Isn't that falsifying legal documents? In many countries that would land you in jail? Am I wrong, did the people really run that risk?

[–] solrize@lemmy.world 1 points 2 weeks ago (3 children)

/me changes name to '); DROP TABLE STUDENTS; --.

[–] Chozo@fedia.io 1 points 2 weeks ago (1 children)

That boy ain't right

[–] funkajunk@lemm.ee 1 points 2 weeks ago

Oh. Yes. Little Bobby Tables, we call him.

[–] ZILtoid1991@lemmy.world 0 points 2 weeks ago (1 children)

Are there character escapes for SQL, to protect against stuff like that?

[–] solrize@lemmy.world 1 points 2 weeks ago

Yes but it's a dangerous process. You should use paramatrized queries instead.

[–] Chewbaccabra@lemmy.world 1 points 2 weeks ago (3 children)

NULL != 'NULL'

How do devs make this mistake

[–] kogasa@programming.dev 2 points 1 week ago

Code is easy in a vacuum. 50 moving parts all with their own quirks and insufficient testing is how you get stuff like this to happen.

[–] kava@lemmy.world 1 points 1 week ago* (last edited 1 week ago)

How do devs make this mistake

it can happen many different ways if you're not explicitly watching out for these types of things

example let's say you have a csv file with a bunch of names

id, last_name
1, schaffer
2, thornton
3, NULL
4, smith
5, "NULL"

if you use the following to import into postgres

COPY user_data (id, last_name)
FROM '/path/to/data.csv'
WITH (FORMAT csv, HEADER true);

number 5 will be imported as a string "NULL" but number 3 will be imported as a NULL value. of course, this is why you sanitize the data (GIGO) but I can imagine this happening countless times at companies all over the country

there are easy fixes if you're paying attention

COPY user_data (id, last_name)
FROM '/path/to/data.csv'
WITH (FORMAT csv, HEADER true, NULL '');

sets the empty string to NULL value.


example with js

fetch('/api/user/1')
  .then(response => response.json())
  .then(data => {
    if (data.lastName == "null") {
      console.log("No last name found");
    } else {
      console.log("Last name is:", data.lastName);
    }
  });

if data is

data = {
  id: 5,
  lastName: "null"
};

then the if statement will trigger- as if there was no last name. that's why you gotta know the language you're using and the potential pitfalls

now you may ask -- why not just do

if (data.lastName === null)

instead? But what if the system you're working on uses JSON.parse(data) and that auto-converts everything to a string? it's a very natural move to check for the string "null"

obviously if you're paying attention and understand the pitfalls of certain languages (like javascript's type coercion and the particularities of JSON.parse()) it becomes easy but it's something that is honestly very easy to overlook

[–] blackn1ght@feddit.uk 1 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

It's baffling to me. Maybe I'm just used to using "modern" frameworks, but the only way this could be an issue is if you literally check if the string value equals "null" and then replace it with a null value.

lastName = lastName.ToUpper() == "NULL" ? null : lastName;

Either that or the database has some bug where it's converting a string value of "null" into a null.

[–] Slaxis@discuss.tchncs.de 1 points 2 weeks ago

That is something I’ve had to do on rare occasions because people set up and store info in stupid ways…

[–] DragonTypeWyvern@midwest.social 1 points 2 weeks ago (1 children)

My academic advisor in college was named Null

Even I kept running into trouble because the system thought I didn't have a registered advisor.

[–] ploot@lemmy.blahaj.zone 1 points 2 weeks ago* (last edited 2 weeks ago) (3 children)

I have never seen this happen, and I don't know what tools would confuse the strings "null" or "Null" with NULL. From the comments in this thread, there are evidently more terribly programmed systems than I imagined.

[–] shotgun_crab@lemmy.world 1 points 2 weeks ago

As long as there's javascript somewhere, anything can happen

[–] DragonTypeWyvern@midwest.social 1 points 2 weeks ago

I'm pretty sure at least some of the university's systems were designed by students.

[–] Atomic@sh.itjust.works 1 points 2 weeks ago

Shit happens, mistakes are sometimes made. Valve once had code that could delete your entire drive.

[–] gedaliyah@lemmy.world 1 points 2 weeks ago

How about XÆa-12? Asking for a friend.

[–] Shardikprime@lemmy.world 0 points 1 week ago

Ah yes, little Nell=%00\u0000'\0'""'0'0x000x30'';

Nellie Null we call her.

She and her cousin Bobby Tables love to scamper around, but they are good kids. They would never break anything intentionally

collapsed inline media