Posts

Showing posts from March, 2025

Oops, No Victims: The Largest Supply Chain Attack Stole 5 Cents

Image
The Biggest NPM Supply Chain Attack What is a Supply Chain Attack? A supply chain attack occurs when attackers target trusted third-party components, such as libraries or registries, instead of attacking users directly. By injecting malicious code at the source, they can spread it to all downstream users. These attacks are dangerous because updates happen automatically in build pipelines, making detection harder. A small modification in a common dependency can silently compromise thousands of projects. Defenses require strong authentication, artifact signing, reproducible builds, and active monitoring of supply chain integrity. Introduction On September 8, 2025, the npm ecosystem faced one of its largest compromises. A maintainer’s account was hijacked, and malicious versions of popular packages were published. Since npm packages are used globally in countless projects, the exposure was immediate and severe. Although the financial damage was limited, the operational dis...

Flask Cookie

Image
A cookie is a small piece of data stored on the user’s browser by a website. It helps websites remember user preferences, authentication status, and other session-related data. Key features of ccookies: ✅ Stored on the client-side (browser). ✅ Sent with each request to the server. ✅ Used for sessions, authentication, tracking, and personalization. ✅ Can have attributes like expiration time, HTTPOnly, Secure, and SameSite for security. 🏗 What is a Flask Cookie? A Flask cookie is a way to store data on the user’s browser using Flask’s set_cookie() method. Flask allows developers to set, read, and delete cookies easily. How Flask Uses Cookies: 1️⃣ Setting a Cookie: resp.set_cookie('key', 'value') 2️⃣ Getting a Cookie: request.cookies.get('key') 3️⃣ Deleting a Cookie: resp.set_cookie('key', '', expires=0) from flask import Flask, render_template, request, url_for, redirect, make_response, flash, session import rand...