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

      June 2025: All AI updates from the past month

      June 30, 2025

      Building a culture that will drive platform engineering success

      June 30, 2025

      Gartner: More than 40% of agentic AI projects will be canceled in the next few years

      June 30, 2025

      Never Stop Exploring (July 2025 Wallpapers Edition)

      June 30, 2025

      I never thought I’d praise a kickstand power bank – until I tried this one

      June 30, 2025

      I replaced my work PC with this Alienware laptop – now I’m wondering why I hadn’t done this sooner

      June 30, 2025

      How to set up Alexa to receive notifications on Prime Day deals you want

      June 30, 2025

      How proxy servers actually work, and why they’re so valuable

      June 30, 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

      Top 6 MySQL Database Management Struggles for Laravel Developers (And Smart Fixes)

      June 30, 2025
      Recent

      Top 6 MySQL Database Management Struggles for Laravel Developers (And Smart Fixes)

      June 30, 2025

      What’s the difference between named functions and arrow functions in JavaScript?

      June 30, 2025

      Spring Boot + Swagger: A Complete Guide to API Documentation

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

      Relive the Golden Era: 5 Tools to Get Retro Feel on Linux

      June 30, 2025
      Recent

      Relive the Golden Era: 5 Tools to Get Retro Feel on Linux

      June 30, 2025

      mpvc – mpc-like CLI tool for mpv

      June 30, 2025

      sherpa-onnx is speech-to-text and text-to-speech software

      June 30, 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

    I never thought I’d praise a kickstand power bank – until I tried this one

    June 30, 2025
    News & Updates

    I replaced my work PC with this Alienware laptop – now I’m wondering why I hadn’t done this sooner

    June 30, 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

    PlayPraetor Reloaded: CTM360 Uncovers a Play Masquerading Party

    PlayPraetor Reloaded: CTM360 Uncovers a Play Masquerading Party

    Development

    COSMIC Desktop Alpha 7 Brings More New Features

    Linux

    CVE-2025-3997 – Dazhouda lecms Cross-Site Request Forgery (CSRF) Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-2761 – GIMP FLI File Parsing Out-Of-Bounds Write Remote Code Execution Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    CVE-2025-47705 – Drupal IFrame Remove Filter Cross-Site Scripting (XSS)

    May 14, 2025

    CVE ID : CVE-2025-47705

    Published : May 14, 2025, 5:15 p.m. | 1 hour, 51 minutes ago

    Description : Improper Neutralization of Input During Web Page Generation (‘Cross-site Scripting’) vulnerability in Drupal IFrame Remove Filter allows Cross-Site Scripting (XSS).This issue affects IFrame Remove Filter: from 0.0.0 before 2.0.5.

    Severity: 0.0 | NA

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

    ClamAV 1.4.3 and 1.0.9 Released With Fix for Vulnerabilities that Enable Remote Code Execution

    June 20, 2025

    Laravel Seeder Generator

    May 12, 2025

    Mapping the misuse of generative AI

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

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