Skip to content

Keeping My Projects on Current Versions: A Security Check-Up

In December 2025, a flaw called React2Shell let attackers run their own code on servers built with React Server Components. One crafted web request was enough. Attackers were exploiting it within days, and the fix was an upgrade to patched versions of React and Next.js.

I keep my own projects on current versions as a habit, because the fix for a flaw like this is usually a new release. In late October 2026, I gave five of my open-source VS Code extensions the same security check-up. This post shows why staying current matters and shares the checklist I used.

Navigate this post

Exploits hit old versions

Here are three serious flaws in widely used libraries from the past year. CISA, the US cybersecurity agency, lists all three in its catalog of vulnerabilities that attackers have used on real systems.

Flaw What an attacker could do The fix
React2Shell in React Server Components (December 2025) Run code on the server with one crafted web request. Upgrade React to 19.0.1, 19.1.2, or 19.2.1, and Next.js to a patched release.
LiteLLM, a Python library for calling AI models (2026) Reach the AI tools the server offers by sending a fake sign-in header. Upgrade litellm to 1.84.0.
Starlette, the base of the FastAPI web framework (2026) Slip past security checks with a malformed Host header, the part of a request that names the website. Upgrade Starlette to 1.0.1.

In all three cases, the fix was a new version. A project was protected once it moved to that version.

Diagram: Upgrading to the fixed version protects a project

flowchart TD
    accTitle: A fix protects only upgraded projects
    accDescr: A flaw is found in a library and the maintainers publish a fixed version. Projects that upgrade are protected, and projects that stay on the old version remain open to attack.
    classDef default fill:#64748B1F,stroke:#64748B,stroke-width:1.5px;
    classDef c1 fill:#2563EB24,stroke:#3B82F6,stroke-width:2px;
    classDef c2 fill:#7C3AED24,stroke:#8B5CF6,stroke-width:1.5px;
    classDef c3 fill:#05966924,stroke:#10B981,stroke-width:1.5px;
    classDef c4 fill:#D9770624,stroke:#F59E0B,stroke-width:1.5px;
    classDef c5 fill:#DC262624,stroke:#EF4444,stroke-width:2px;

    A["Flaw found in a library"]:::c5 --> B["Maintainers publish a fixed version"]:::c2
    B --> C{"Has the project upgraded?"}:::c4
    C -->|"yes"| D["Protected"]:::c3
    C -->|"no"| E["Still open to attack"]:::c5

AI tools now find flaws faster as well. As of 2 November 2026, Anthropic reports that its Claude models have found and disclosed more than 5,000 vulnerabilities across 680 open-source projects. More flaws found means more fixed versions for projects to pick up.

Keep every library current

The first part of my check-up covered the outside libraries each extension uses.

Check Why it matters What I did
Pin every library to an exact version A pin names one exact version. Without a pin, the package manager can install a different release on its own, and nobody reviews the change. Lightweight Markdown Preview moved Mermaid, its diagram library, from "any version 11" to exactly 12.1.0.
Upgrade to current releases New releases carry the latest security fixes. Safe PDF Viewer moved to version 6.4.299 of PDF.js, the PDF engine it ships.
Clear dependency warnings npm audit, a command built into npm, lists known flaws in the packages a project installs. After the upgrades, npm audit listed no known flaws for Lightweight Markdown Preview.

A pin keeps a version fixed until you change it. A regular upgrade makes sure you change it soon after each fix.

Diagram: A pinned version changes only through a reviewed upgrade

flowchart LR
    accTitle: Pinned versions change through reviewed upgrades
    accDescr: An extension pins Mermaid at version 12.1.0. When a fix is published, the maintainer upgrades and runs npm audit, and the result is a new pinned version.
    classDef default fill:#64748B1F,stroke:#64748B,stroke-width:1.5px;
    classDef c1 fill:#2563EB24,stroke:#3B82F6,stroke-width:2px;
    classDef c2 fill:#7C3AED24,stroke:#8B5CF6,stroke-width:1.5px;
    classDef c3 fill:#05966924,stroke:#10B981,stroke-width:1.5px;
    classDef c4 fill:#D9770624,stroke:#F59E0B,stroke-width:1.5px;
    classDef c5 fill:#DC262624,stroke:#EF4444,stroke-width:2px;

    A["Pinned version<br/>━━━<br/>Mermaid 12.1.0"]:::c3 -->|"fix published"| B["Upgrade and run npm audit"]:::c2
    B -->|"audit clean"| C["New pinned version"]:::c3

Limit what a flaw can reach

The second part of the check-up limits the damage any flaw could do, including flaws nobody has reported yet. Each extension shows content from files someone else may have written, inside a VS Code panel that works like a small web page.

Check What I did
Allow only the extension's own scripts Each time the panel opens, the extension creates a random key. Only scripts that carry the key run, and scripts inside a document never carry it.
Run diagrams in strict mode In Mermaid's strict mode, clicks inside a diagram do nothing.
Show text from files as text Diagram source is escaped, so a character like < displays as a character.
Support Restricted Mode All five extensions work in folders that VS Code has not marked as trusted.

The panel shows what a document contains and runs none of its code.

Diagram: The panel shows a document's content and blocks its scripts

flowchart LR
    accTitle: The panel shows content and blocks scripts
    accDescr: A Markdown file, diagram, or PDF from someone else goes into the extension panel. The panel shows its text, diagrams, and pages, and blocks any scripts inside it.
    classDef default fill:#64748B1F,stroke:#64748B,stroke-width:1.5px;
    classDef c1 fill:#2563EB24,stroke:#3B82F6,stroke-width:2px;
    classDef c2 fill:#7C3AED24,stroke:#8B5CF6,stroke-width:1.5px;
    classDef c3 fill:#05966924,stroke:#10B981,stroke-width:1.5px;
    classDef c4 fill:#D9770624,stroke:#F59E0B,stroke-width:1.5px;
    classDef c5 fill:#DC262624,stroke:#EF4444,stroke-width:2px;

    A["Markdown, diagram, or PDF<br/>from someone else"]:::c5 --> B["Extension panel<br/>━━━<br/>Random script key<br/>Strict diagrams<br/>Escaped text"]:::c2
    B -->|"shows"| C["Text, diagrams, and pages"]:::c1
    B -->|"blocks"| D["Scripts inside the document"]:::c5

Make it a routine

The third part of the check-up makes the work repeat. A security advisory, the public notice that names a flaw and its fixed version, starts each round.

Diagram: Each security advisory starts the next update cycle

flowchart TD
    accTitle: The update cycle
    accDescr: A new security advisory leads to an upgrade of the pinned version, automated tests and an audit check the change, the new version ships, and the next advisory starts the cycle again.
    classDef default fill:#64748B1F,stroke:#64748B,stroke-width:1.5px;
    classDef c1 fill:#2563EB24,stroke:#3B82F6,stroke-width:2px;
    classDef c2 fill:#7C3AED24,stroke:#8B5CF6,stroke-width:1.5px;
    classDef c3 fill:#05966924,stroke:#10B981,stroke-width:1.5px;
    classDef c4 fill:#D9770624,stroke:#F59E0B,stroke-width:1.5px;
    classDef c5 fill:#DC262624,stroke:#EF4444,stroke-width:2px;

    A["New security advisory"]:::c5 --> B["Upgrade the pinned version"]:::c2
    B --> C["Automated tests and npm audit run"]:::c4
    C --> D["Release the new version"]:::c1
    D -->|"next advisory"| A

Three habits support the cycle:

  • Checks on every change: every change to an extension runs the tests and an npm audit of the packages users receive.
  • Tests for the security rules: tests confirm the panel's security rules, so a later edit cannot remove them by accident.
  • One setup for all five: the five extensions share one build and release setup, so a fix to that shared setup goes into all five.

NotionDown, the newest of the five extensions, was built that same week with these rules in place from the first commit.

Run your own check-up

You can run the same check-up on any project that uses outside libraries:

  1. List every outside library your project uses, and pin each one to an exact version.
  2. Upgrade each library to its current release, and clear the warnings from your package manager's audit.
  3. Limit what content from other people can do inside your project.
  4. Add tests and an audit to your automated build.
  5. Repeat the upgrade whenever a security advisory names a library you use.

Conclusion

React2Shell, LiteLLM, and Starlette share one fix: a new version. I keep my projects on current versions so that fix reaches them quickly. Pick one of your projects and run the checklist this week.

References and further reading

Open the complete reference catalog

Primary Sources