Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. This seriously belongs here...

This seriously belongs here...

Scheduled Pinned Locked Moved The Weird and The Wonderful
questioncsharpdotnetwcfcom
8 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Brisingr Aerowing
    wrote on last edited by
    #1

    string isValidArticle(string article) - The Daily WTF[^] A Zero-Day exploit in the .NET framework through the WSDL parser. :wtf:

    What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

    D D Richard DeemingR B B 6 Replies Last reply
    0
    • B Brisingr Aerowing

      string isValidArticle(string article) - The Daily WTF[^] A Zero-Day exploit in the .NET framework through the WSDL parser. :wtf:

      What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

      D Offline
      D Offline
      Daniel Pfeffer
      wrote on last edited by
      #2

      We need a new icon for "coding horror". Perhaps a WTF with its hair standing on end?

      If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

      1 Reply Last reply
      0
      • B Brisingr Aerowing

        string isValidArticle(string article) - The Daily WTF[^] A Zero-Day exploit in the .NET framework through the WSDL parser. :wtf:

        What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        I've always had this standard of code that I thought was "Microsoft quality". Granted, given the number of bugs and "features over fix" commonly found in Microsoft products, this bar was not set high. This ... "sample", for lack of a sufficiently derogatory term, just jumps on that bar and smashes it into the ground. How the :elephant: that code ever made it past review, let alone testing, is beyond my too-early-in-the-morning-on-a-weekend comprehension.

        System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

        Click this: Asking questions is a skill. Seriously, do it.
        Dave Kreskowiak

        1 Reply Last reply
        0
        • B Brisingr Aerowing

          string isValidArticle(string article) - The Daily WTF[^] A Zero-Day exploit in the .NET framework through the WSDL parser. :wtf:

          What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          It's a shame the article doesn't quite explain the problem properly. The code is generating a verbatim string literal, so newlines in the string don't need to be encoded or escaped. Source:

          This is a perfectly valid
          verbatim string literal
          across multiple lines.

          Output:

          string foo = @"This is a perfectly valid
          verbatim string literal
          across multiple lines.";

          Unfortunately, that string literal ends up being placed in a single-line comment, which only comments out the first line. :doh: Source:

          This is a commented-out verbatim string literal.
          System.Diagnostics.Process.Start("evil-code.exe");
          //

          Output:

          // string foo = @"This is a commented-out verbatim string literal.
          System.Diagnostics.Process.Start("evil-code.exe");
          // ";


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          1 Reply Last reply
          0
          • B Brisingr Aerowing

            string isValidArticle(string article) - The Daily WTF[^] A Zero-Day exploit in the .NET framework through the WSDL parser. :wtf:

            What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

            B Offline
            B Offline
            Baraaaaaa
            wrote on last edited by
            #5

            Here's a link to the Microsoft reference source for that specific function - IsValidUrl() :) Reference Source - IsValidUrl(string)[^]

            1 Reply Last reply
            0
            • B Brisingr Aerowing

              string isValidArticle(string article) - The Daily WTF[^] A Zero-Day exploit in the .NET framework through the WSDL parser. :wtf:

              What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

              B Offline
              B Offline
              BuggyTimes
              wrote on last edited by
              #6

              Good find by the hackers, just reading the code made me really cringe, mainly because I'm nowhere near awake enough to parse it correctly. Whether it's a gross missnaming or the devs not checking what isValidURL() actually validates one can be certain oversights were made. I'm in the middle of refactoring some css to make it clear and this article is yet another validation to striving to name things to the best of ones ability. My issue is naturally trivial in comparison and there is zero possibility of failing in such an impactful way, but clear code speaks for itself.

              1 Reply Last reply
              0
              • B Brisingr Aerowing

                string isValidArticle(string article) - The Daily WTF[^] A Zero-Day exploit in the .NET framework through the WSDL parser. :wtf:

                What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

                F Offline
                F Offline
                Fueled By Decaff
                wrote on last edited by
                #7

                Apart from being badly named and using a global static that code is not too bad. The code that is the real hair-raiser is the code that assumes it is safe to comment it out using a single line comment.

                L 1 Reply Last reply
                0
                • F Fueled By Decaff

                  Apart from being badly named and using a global static that code is not too bad. The code that is the real hair-raiser is the code that assumes it is safe to comment it out using a single line comment.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Nothing is global in .NET; also, a single static StringBuilder is not going to consume large amounts of memory.

                  Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups