Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      How To Prevent WordPress SQL Injection Attacks

      June 13, 2025

      This week in AI dev tools: Apple’s Foundations Model framework, Mistral’s first reasoning model, and more (June 13, 2025)

      June 13, 2025

      Open Talent platforms emerging to match skilled workers to needs, study finds

      June 13, 2025

      Java never goes out of style: Celebrating 30 years of the language

      June 12, 2025

      OneDrive for Mac will soon give you more flexible storage options

      June 13, 2025

      From The Editor’s Desk — new Windows Central community features, we’d like to hear from you!

      June 13, 2025

      New code strings attached to Xbox Game Pass suggests a price increase may be imminent

      June 13, 2025

      This could be the versatile laptop accessory I’ve been waiting for — Here’s why it stands out from other portable monitors

      June 13, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Worker Threads in Node.js: A Complete Guide for Multithreading in JavaScript

      June 13, 2025
      Recent

      Worker Threads in Node.js: A Complete Guide for Multithreading in JavaScript

      June 13, 2025

      Everybody’s gone lintin’

      June 13, 2025

      QAQ-QQ-AI-QUEST

      June 13, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      OneDrive for Mac will soon give you more flexible storage options

      June 13, 2025
      Recent

      OneDrive for Mac will soon give you more flexible storage options

      June 13, 2025

      From The Editor’s Desk — new Windows Central community features, we’d like to hear from you!

      June 13, 2025

      New code strings attached to Xbox Game Pass suggests a price increase may be imminent

      June 13, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: A Jammed Up Session

    CodeSOD: A Jammed Up Session

    May 15, 2025

    Andre has inherited a rather antique ASP .Net WebForms application. It’s a large one, with many pages in it, but they all follow a certain pattern. Let’s see if you can spot it.

    protected void btnSearch_Click(object sender, EventArgs e)
    {
        ArrayList paramsRel = new ArrayList();
        paramsRel["Name"] = txtNome.Text;
        paramsRel["Date"] = txtDate.Text;
        Session["paramsRel"] = paramsRel;
       
        List<Client> clients = Controller.FindClients();
        //Some other code
    }
    

    Now, at first glance, this doesn’t look terrible. Using an ArrayList as a dictionary and frankly, storing a dictionary in the Session object is weird, but it’s not an automatic red flag. But wait, why is it called paramsRel? They couldn’t be… no, they wouldn’t…

    public List<Client> FindClients()
    {
        ArrayList paramsRel = (ArrayList)Session["paramsRel"];
        string name = (string)paramsRel["Name"];
        string dateStr = (string)paramsRel["Date"];
        DateTime date = DateTime.Parse(dateStr);
       
       //More code...
    }
    

    Now there’s the red flag. paramsRel is how they pass parameters to functions. They stuff it into the Session, then call a function which retrieves it from that Session.

    This pattern is used everywhere in the application. You can see that there’s a vague gesture in the direction of trying to implement some kind of Model-View-Controller pattern (as FindClients is a member of the Controller object), but that modularization gets undercut by everything depending on Session as a pseudoglobal for passing state information around.

    The only good news is that the Session object is synchronized so there’s no thread safety issue here, though not for want of trying.

    [Advertisement]
    Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.Learn more.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous Articlecoturn is an implementation of TURN and STUN Server
    Next Article SunFounder Pironman 5 NVMe Mini PC Case Review

    Related Posts

    News & Updates

    OneDrive for Mac will soon give you more flexible storage options

    June 13, 2025
    News & Updates

    From The Editor’s Desk — new Windows Central community features, we’d like to hear from you!

    June 13, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    Universal Design Principles Supporting Operable Content – Equitable Use

    Development

    ChatGPT Now Recommends Products and Prices With New Shopping Features

    Artificial Intelligence

    CVE-2025-44019 – AVEVA PI Data Archive Denial of Service (DoS) Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Scalable and Principled Reward Modeling for LLMs: Enhancing Generalist Reward Models RMs with SPCT and Inference-Time Optimization

    Machine Learning

    Highlights

    CVE-2025-3845 – Markparticle WebServer Buffer Overflow Vulnerability

    April 21, 2025

    CVE ID : CVE-2025-3845

    Published : April 21, 2025, 10:15 p.m. | 16 minutes ago

    Description : A vulnerability was found in markparticle WebServer up to 1.0. It has been declared as critical. Affected by this vulnerability is the function Buffer::HasWritten of the file code/buffer/buffer.cpp. The manipulation of the argument writePos_ leads to buffer overflow. The attack can be launched remotely. The exploit has been disclosed to the public and may be used.

    Severity: 7.3 | HIGH

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    What is a microSD Express Card, and should I use it in my gaming handheld?

    April 2, 2025

    Paragon Spyware used to Spy on European Journalists

    June 13, 2025

    Activepieces is business automation software

    April 28, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.