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

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 16, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 16, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 16, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 16, 2025

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025

      Minecraft licensing robbed us of this controversial NFL schedule release video

      May 16, 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 power of generators

      May 16, 2025
      Recent

      The power of generators

      May 16, 2025

      Simplify Factory Associations with Laravel’s UseFactory Attribute

      May 16, 2025

      This Week in Laravel: React Native, PhpStorm Junie, and more

      May 16, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025
      Recent

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 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

    Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

    May 16, 2025
    News & Updates

    Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

    May 16, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    You will always remember this as the day you finally caught FamousSparrow

    Development

    20+ Best Free Futuristic Fonts for Designers

    Development

    Car owners are bullish on AI agents repairing the US auto industry – here’s why

    News & Updates

    TMF Group Welcomes Kumar Ravi as New Chief Information Security Officer

    Development
    GetResponse

    Highlights

    CVE-2025-2558 – “WordPress Theme-Wound LFI Vulnerability”

    April 24, 2025

    CVE ID : CVE-2025-2558

    Published : April 24, 2025, 6:15 a.m. | 1 hour, 25 minutes ago

    Description : The-wound WordPress theme through 0.0.1 does not validate some parameters before using them to generate paths passed to include function/s, allowing unauthenticated users to perform LFI attacks and download arbitrary file from the server

    Severity: 0.0 | NA

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

    Amazon will give you a $100 gift card when you buy a Samsung Galaxy Ring

    May 6, 2025

    200,000 SelectBlinds customers have their card details skimmed in malware attack

    November 11, 2024

    LWiAI Podcast #166 – new AI song generator, Microsoft’s GPT4 efforts, AlphaFold3, xLSTM, OpenAI Model Spec

    May 12, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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