Selfhost Cat
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Lena@gregtech.eu to Programmer Humor@programming.devEnglish · 9 days ago

Found in psycopg docs

gregtech.eu

message-square
10
fedilink
159

Found in psycopg docs

gregtech.eu

Lena@gregtech.eu to Programmer Humor@programming.devEnglish · 9 days ago
message-square
10
fedilink
alert-triangle
You must log in or register to comment.
  • abbadon420@lemm.ee
    link
    fedilink
    arrow-up
    28
    ·
    9 days ago

    Putting the psyco in psycopg

  • 9point6@lemmy.world
    link
    fedilink
    arrow-up
    20
    ·
    9 days ago

    Flashbacks to one of my early freelance PHP gigs I did about 2 decades ago where I opened up the existing backend source code to find a load of unsanitised user input directly from the query string getting interpolated into the various SQL queries the application made. Part of me also feels like the “bobby tables” xkcd already existed by this point, so I’ve got no idea how that website managed to not get nuked before I refactored it.

    To top it all off, of course the application authenticated with the database using the root user…

    Thankfully I think that was the worst I ever discovered in the wild

  • cm0002@lemmy.world
    link
    fedilink
    arrow-up
    12
    ·
    9 days ago

    Im gonna manually merge values to a query

  • Lucy :3@feddit.org
    link
    fedilink
    arrow-up
    10
    ·
    9 days ago

    Why is it only a yellow warning, and not a red one?

    • vithigar@lemmy.ca
      link
      fedilink
      arrow-up
      26
      ·
      9 days ago

      There’s an edge case where you want the guys in balaclavas to show up.

      • Quetzalcutlass@lemmy.world
        link
        fedilink
        English
        arrow-up
        12
        ·
        9 days ago

        When you hope they’re dyslexic and show up with delicious baklavas instead.

        • Lena@gregtech.euOP
          link
          fedilink
          English
          arrow-up
          7
          ·
          9 days ago

          That’s how I read it at first

    • mmddmm@lemm.ee
      link
      fedilink
      arrow-up
      4
      ·
      9 days ago

      To add. The specific edge case where you want to do the balaclava thing is when you are concatenating internally generated column and table names, operators, and entire conditions with extra parameters that you will add the correct way.

  • JATth@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    7 days ago

    Holy hell, thats rough. :D

  • moonpiedumplings@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    9 days ago

    Docs:

    https://www.psycopg.org/psycopg3/docs/basic/params.html#danger-sql-injection

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 697 users / day
  • 4.52K users / week
  • 8.93K users / month
  • 15.6K users / 6 months
  • 1 local subscriber
  • 23.1K subscribers
  • 644 Posts
  • 11.5K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.8
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org