SShortSingh.
Back to feed

A security checklist for Next.js apps handling sensitive tenant data

0
·2 views

A developer describes the protections built into a platform for Residency Kondapur that stores tenants' names, phone numbers, rent bills and payment screenshots. The measures include hashing passwords with bcrypt, comparing secrets in constant time, and returning a single generic error for every authentication failure. Session tokens are signed with HMAC-SHA256 and given short lifetimes, with cookies set as httpOnly, SameSite=Strict and Secure. The checklist also covers Zod input validation, Origin header checks, per-IP rate limiting, security headers, and no-store caching for private routes. The author presents these as routine practices applied consistently rather than exotic techniques.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

ContHunt MCP Server Lets Claude Code and Cursor Query Short-Form Video Data

A developer guide explains how to connect ContHunt's hosted Model Context Protocol server to Claude Code and Cursor. The server gives AI coding agents access to public TikTok, Instagram Reels, and YouTube Shorts performance data. Setup involves a single command or config file entry, followed by OAuth sign-in through a browser. The article describes tools for checking credits, running SQL queries on saved searches, performing keyword searches, and fetching creator profiles. It also cites a 2026 benchmark of 1,500 videos showing highly skewed view distributions across the three platforms.

0
ProgrammingDEV Community ·

Ternary Bonsai 2.5 27B needs far more GPU memory for its context than its file size suggests

The 27-billion-parameter Ternary Bonsai 2.5 model stores its weights at about 1.76 bits, so its roughly 5.5 GiB of weights look small enough for an 8 GB card. At the full 262,144-token context, however, llama.cpp consumed about 26.2 GiB on an H200, mostly for a key-value cache reserved at start-up. Researchers measured how memory scales with context length, cache precision of 16, 8, and 4 bits, and concurrent requests. Quantizing the cache to lower bits substantially reduces the footprint, and each extra request adds roughly 0.6 GiB. The model also outperformed Qwen3.8-27B FP8 on AppWorld agent tasks in completion count and cost, though it ran more slowly.

0
ProgrammingDEV Community ·

PVS-Studio Static Analysis Uncovers Memory and Logic Errors in Scilab Source Code

Developers examined the open-source mathematical software Scilab using the PVS-Studio static analyzer to identify potential defects. The review highlighted several intriguing issues, including mismatched memory allocation and deallocation that can trigger undefined behavior. Another finding involved a pointer being dereferenced before its null check, caused by a typo in the verification logic. The authors argue that static analysis complements testing and code reviews by catching bugs early, saving time for feature development. The analysis was performed on the project at a specific commit using PVS-Studio version 8.00.

0
ProgrammingDEV Community ·

Data contracts must encode meaning, not just structure, to guard against silent agent-driven changes

A data contract is a written, verified agreement between dataset owners and the people and agents who use it. Standard checks for type, nullability and freshness validate structure, but costly errors often alter a field's meaning while leaving its structure untouched. The author illustrates this with an online shop's 'is_active_customer' flag, which doubled after a coding agent changed its time window from 90 to 365 days without any test failing. Andrew Jones has made a similar point using an amount field that switched from including tax to excluding it. The author argues that AI agents on both producing and consuming sides make unwritten definitions riskier, and a small test on a made-up repository found a contract with named owners reduced unapproved changes. The proposed fix is a short written block of meaning for each key field, placed where agents work.