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

      CodeSOD: A Unique Way to Primary Key

      July 22, 2025

      BrowserStack launches Figma plugin for detecting accessibility issues in design phase

      July 22, 2025

      Parasoft brings agentic AI to service virtualization in latest release

      July 22, 2025

      Node.js vs. Python for Backend: 7 Reasons C-Level Leaders Choose Node.js Talent

      July 21, 2025

      The best CRM software with email marketing in 2025: Expert tested and reviewed

      July 22, 2025

      This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

      July 22, 2025

      I’m a wearables editor and here are the 7 Pixel Watch 4 rumors I’m most curious about

      July 22, 2025

      8 ways I quickly leveled up my Linux skills – and you can too

      July 22, 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

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025
      Recent

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025

      Zero Trust & Cybersecurity Mesh: Your Org’s Survival Guide

      July 22, 2025

      Execute Ping Commands and Get Back Structured Data in PHP

      July 22, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025
      Recent

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025

      “I don’t think I changed his mind” — NVIDIA CEO comments on H20 AI GPU sales resuming in China following a meeting with President Trump

      July 22, 2025

      Galaxy Z Fold 7 review: Six years later — Samsung finally cracks the foldable code

      July 22, 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

    The best CRM software with email marketing in 2025: Expert tested and reviewed

    July 22, 2025
    News & Updates

    This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

    July 22, 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

    CVE-2025-2524 – Ninja Forms WordPress Stored Cross-Site Scripting Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-27703 – Absolute Secure Access Privilege Escalation Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Hackers Actively Exploiting Fortigate Vulnerabilities to Deploy Qilin Ransomware

    Security

    CVE-2025-24916 – Tenable Network Monitor Local Privilege Escalation

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    CVE-2025-50039 – VG WORT METIS Missing Authorization Vulnerability

    July 4, 2025

    CVE ID : CVE-2025-50039

    Published : July 4, 2025, 12:15 p.m. | 2 hours ago

    Description : Missing Authorization vulnerability in vgwort VG WORT METIS allows Exploiting Incorrectly Configured Access Control Security Levels. This issue affects VG WORT METIS: from n/a through 2.0.0.

    Severity: 6.5 | MEDIUM

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

    CVE-2025-22241 – Apache Ansible VirtKey Directory Traversal Vulnerability

    June 13, 2025

    Zoom Patches 6 Flaws: DoS, Info Disclosure & XSS Across All Platforms

    July 9, 2025

    Laravel Audit Log

    June 10, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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