If spammers can abuse something, they gonna abuse it

  • Björn Tantau@swg-empire.de
    link
    fedilink
    arrow-up
    2
    ·
    5 months ago

    I mean, allowing arbitrary characters in the name is one thing. I think I would do that as well, as there are many weird names out there.

    But then actually parsing it out (or not escaping it properly), that’s the real sin.

  • haui@lemmy.giftedmc.com
    link
    fedilink
    arrow-up
    1
    ·
    5 months ago

    Something I just thought about for the first time: the sheer amount of spam content everywhere (website comments, mails, bots) seems to indicate that there must be ungodly amounts of money being made but I rarely see politicians actually talk about the topic and doing something against it.

    Can anyone confirm/explain?

    • SpaceCowboy@lemmy.ca
      link
      fedilink
      arrow-up
      1
      ·
      5 months ago

      One of the major issues with creating legislation to block spam emails (and spam phone calls) is that it would also impact the fundraising capabilities of political parties.

      Politicians don’t talk about spam, because politicians use spam to raise money money for their campaigns.

    • Sekoia@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      5 months ago

      Somebody created an account at MyEpson with OP’s email address and the name “GET BITCOIN NOW link”, which sends a confirmation email to OP with that name. Basically it’s spam using Epson as a trojan horse to get past filters.

    • Dark Arc@social.packetloss.gg
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      5 months ago

      That’s not how this works.

      You have a database driver that takes care of communicating with the database.

      In the bad old days (pre-early 2000s) the only way they knew how to do that was plain old SQL strings so you passed a string that contained both the data and the instructions on what to do with it.

      Now you SHOULD be writing prepared statements that contain the instructions then passing the data separately to fill in the placeholders in the prepared statement via the driver (NOT via modifying the string).

      // DO NOT DO THIS
      execute("INSERT INTO foo VALUES ('a', 'b', 'c')")
      

      vs

      // DO THIS
      executePrepared("INSERT INTO foo VALUES (?,?,?)", "a", "b", "c")
      
            • Dark Arc@social.packetloss.gg
              link
              fedilink
              English
              arrow-up
              2
              ·
              edit-2
              5 months ago

              It’s a common problem for the same reason that it’s a common problem for people to have precision errors when doing math with currencies… People write the wrong code because they don’t know any better (in that case using float or double/floating point math instead of a BigDecimal type).

              Not filtering out characters that could be part of URL has no bearing on whether or not the site is properly protected from SQL injection. I’m much more often worried about sites that explicitly filter out certain characters because it likely means they don’t understand what they’re doing (similar to sites that insist on annual password changes).

              The fact that people are arguing about this shows how much of an issue we have with education on this topic.

      • TigrisMorte@kbin.social
        link
        fedilink
        arrow-up
        0
        arrow-down
        1
        ·
        5 months ago

        Please explain how you remain confident of that “SHOULD” when they are not sanitizing the HTML out?

        • Dark Arc@social.packetloss.gg
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 months ago

          Because it’s literally impossible for SQL injection to occur if you do this. The database has already compiled the operation. There’s nothing to escape, there’s no more logic that can be added, you’re free to insert arbitrary gook just like you can into any old array.

    • ares35@kbin.social
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      never trust user input. the web site should be looking for and filtering this shit out.

      the other one (the submission page at the university, was right above this one in my ‘all’ feed) shows it better–with a full valid link in a text box. should be filtered and rejected by the form submission handler and never inserted into the database. in the case of no ‘http’ as part of it, links still follow a format, and those should be rejected too.

      mod_security filters that shit out on my sites, the rules on what’s allowed in a form field hardly ever get ‘tested’ anymore since i turned that on.

      • El Barto@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        5 months ago

        Never trusting user input, sure. That, I know. And probably the university’s devs do as well.

        However, it’s not the university’s website’s fault that the email client is converting the name to a link.

        So what you’re saying is, email clients should not convert link-like text to actual clickable links. Correct?

        • ares35@kbin.social
          link
          fedilink
          arrow-up
          0
          ·
          5 months ago

          the university’s form allowed the link or link-like string in the text field. that’s on them.

          mail clients should at least be warning users about links it converts from text into clickable markup. yes.

          • El Barto@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            5 months ago

            We’re going in circles. How do you know a name that looks like a link is actually a link or a real name?

            How do you solve that problem in a way that names that look like links are still accepted?

            Plus the way email clients parse plain text is not the university’s website’s responsibility. Today, it’s links. Tomorrow, it’s “embedded AI prompts” or “mini-QR codes,” or “new format telephone numbers,” etc.