Painel de Notícias

Tecnologia

7045 posts · 26 feeds · tópicos e interesse por Jev

Filtros
dev.to

AI Agent Infrastructure: How to Build a Production-Ready Integration Layer

Most AI agents look impressive in a demo and fall apart in their first week of real traffic. The model is rarely the reason. The trouble starts in the layer between the model and the outside world, where tokens expire, providers throttle requests, schemas change, and a single retry can charge a customer twice. This guide explains how to design AI agent infrastructure that holds up in production. You will learn the five layers every AI agent integration layer needs, how to secure tool access with OAuth 2.1, least privilege, and prompt injection defenses, and how to make tool calls reliable with idempotency, backoff, and structured errors. We also cover where MCP fits, when it is the wrong choice, and how to decide between building and buying, with a checklist you can run before launch. If you are moving production-ready AI agents out of a prototype, or planning an MCP integration layer for your product, this is the full list of what you need to own. AI agent infrastructure breaks in production because a demo hides almost every hard problem. A demo has one user, one set of static credentials, clean data, and someone watching the screen. Production has thousands of users, tokens that expire, providers that throttle you, schemas that change without notice, and a security team asking who approved each action. A better model fixes none of that. The industry numbers point the same way. Gartner has predicted that more than 40% of agentic AI projects will be canceled by the end of 2027, citing escalating costs, unclear business value, and inadequate risk controls. Most of those risks sit in the plumbing around the model, not in the model itself. Here is what typically goes wrong once an agent leaves the prototype stage: Silent bad data: A tool returns HTTP 200 with truncated or partial results. The agent treats it as complete and gives a confident, wrong answer. Credential sprawl: Static API keys get shared across users and environments, so one leaked key exposes everything.

IADev
Interesse
dev.to

How We Structured Next.js 15 App Router + Supabase Auth with Zero Leaks

If you migrated to Next.js 15 recently, you probably ran into the subtle landmines scattered across server-side authentication. With React 19 server components, asynchronous request APIs (await cookies(), await headers()), and deprecation of legacy auth helpers (@supabase/auth-helpers-nextjs), the old copy-paste boilerplate from 2023 no longer works safely. Worse: if you implement server-side auth incorrectly in Next.js 15, your application won't necessarily crash. Instead, it will fail silently — leaking cached user sessions across edge regions, getting stuck in infinite redirect loops on token refreshes, or trusting spoofed JWT tokens in Server Actions because of the infamous getSession() vs getUser() trap. Here is the exact 3-layer architecture we run in production across our micro-SaaS and client apps to ensure rock-solid session handling, zero token leaks, and strict Row Level Security (RLS) enforcement. Before jumping into the implementation, let's address the bugs that bite 90% of teams: getSession() vs getUser() Security Vulnerability Many developers still write this in Server Components and Route Handlers: // ❌ INSECURE: Do not use getSession() for access control on the server const { data: { session } } = await supabase.auth.getSession(); if (!session) redirect('/login'); Why it fails: getSession() reads the local cookie payload without verifying the authenticity of the JWT with the Supabase Auth server. If an attacker tampers with the cookie or supplies an expired/revoked token, getSession() may still return a truthy session object. The Fix: Always use supabase.auth.getUser(). It communicates with the Supabase Auth server (or cryptographically validates the JWT against the project's signing key), ensuring the user ID and claims cannot be forged. cookies() API in Next.js 15 In Next.js 14 and earlier, cookies() was synchronous. In Next.js 15, cookies() returns a Promise . If your Supabase client helper synchronously accesses cookie stores, Next.js throws ru

DevSegurança
Interesse
dev.to

Your AI Agent Will Do Something Terrible. Here's How to Survive It.

Here's a pattern I keep seeing. A team wires up an AI agent that can do real things — send emails, run commands, query and modify the database, call external APIs. The demo is magical. It reads a request, figures out the steps, takes them, reports success. Everyone's impressed, and it ships. Then comes the first incident. It emails the wrong list. It runs a destructive command against the wrong environment. It reads a web page that quietly tells it to do something nobody asked for, and it obliges. Suddenly the magical demo is a very un-magical cleanup, and someone's asking how this was allowed to happen. Here's the thing: the demo was never the hard part. Getting an agent to do something is genuinely easy now. The hard part — the part that almost always gets skipped in the rush — is everything that keeps the agent from hurting you when it inevitably does the wrong thing. And it will do the wrong thing, because it's a probabilistic system acting in an unpredictable world. So this is the checklist I think belongs before you let an agent touch anything that matters. Not the fun part. The part that separates an agent you can actually deploy from a liability with a good demo. This is the highest-leverage guardrail, and it's the one most worth getting right first, because it makes entire categories of disaster simply impossible. An agent that cannot reach production cannot wipe production. An agent that cannot send money cannot be talked into sending money. An agent with no access to a system can't be the cause of an incident in that system, no matter how confused or compromised it gets. So the question to ask before anything else isn't "what should this agent be able to do?" — it's "what is the least it needs to do its job?" Then give it exactly that and nothing more. Almost every catastrophic agent story, when you trace it back, turns out to be a permissions decision someone made without quite noticing — handing over credentials that could reach production at all, or a

IADevSegurança
Interesse
dev.to

Shai-Hulud Just Infected an AI Agent Platform's npm Package — What Self-Hosted n8n Builders Must Do Now

On October 8, 2026, the npm package tensorlake — the TypeScript SDK for Tensorlake's AI agent infrastructure — was compromised by a new Shai-Hulud worm variant. Version 0.5.144 shipped a preinstall hook that stole npm tokens, GitHub tokens, AWS keys, SSH keys, .env files, crypto wallets, and browser passwords from every machine that installed it. The version was pulled within minutes, but the malware persists on infected hosts. If you self-host n8n, this is your threat model: you live on npm. Every community node you install, every Docker rebuild that runs npm install, every npx in your CI pipeline runs install scripts. This article walks through exactly how this attack worked — and the concrete checklist that keeps your secrets out of the next one. According to Aikido's analysis, the infection didn't start with a typo-squatted package. It started inside the legitimate tensorlake GitHub repository. On October 7, the threat actor made verified commits under the identity of a maintainer — the malware was introduced in commit 41b38f0 via direct file upload, and the actor then bumped the version to trigger a publish. The repository was compromised for roughly 20 hours before version 0.5.144 went live on npm. Your dependency can be poisoned at the source, not just by a lookalike name. The registry did everything "right" — the package was real, the version was real, the publisher identity was stolen at the repo level. Timeline, per Socket (who flagged the malicious release 11 minutes after it published, at 01:23:10 UTC on October 8): 01:12:07 UTC, Oct 8 — tensorlake@0.5.144 published to npm. 01:23:10 UTC — Socket's scanner flags it; researchers confirm a ChainDrop/Shai-Hulud payload. Shortly after — version 0.5.144 is removed from the registry. Clean versions remain, but damage is already done on any host that ran npm install in between. With ~12,000 weekly downloads and 1k+ GitHub stars, the package's reach is far from trivial — even a minutes-long window can hit CI pipe

SegurançaInfraDev
Interesse
dev.to

ACH vs RTP vs FedNow vs Fedwire: US Rails Guide

Of the eight pages Google currently ranks for "ACH vs RTP vs FedNow", five quote a FedNow limit that has been wrong since November 2025, two still say the RTP cap is $1m, and one claims FedNow only runs between 7am and 7pm. Not one of them names an ISO 20022 message, shows an API payload, or explains why a FedNow "return" is a favour rather than a right. This guide is the version I wanted when I first had to pick a rail per payout for a US treasury product. It covers the four domestic rails an engineer actually touches: ACH, RTP, FedNow and Fedwire, with CHIPS in a footnote. For each one: what the limit is and when it last changed, when the money moves, what messages carry it, what happens when it goes wrong, which legal regime governs the loss, and how the main US payment APIs expose the choice. It is the US counterpart to my Faster Payments vs Bacs vs CHAPS guide, and the mapping between the two is at the end for UK readers. All four settle in US dollars across accounts at the Federal Reserve. Three are operated by the Fed (FedACH, FedNow, Fedwire), one by a bank-owned private company (RTP, The Clearing House), and ACH has a second private operator, EPN, also run by The Clearing House. Everything else differs. ACH RTP FedNow Fedwire Funds Operator FedACH and EPN under Nacha rules The Clearing House Federal Reserve Federal Reserve Speed Next banking day, or same day in three windows Seconds, 24/7/365 Seconds, 24/7/365 Minutes, 22 hours a day on business days Per-payment cap $1m same-day (to $10m on 17 Sep 2027); none for standard $10m (since 9 Feb 2025) $10m network max (Nov 2025); $100k default per bank None Settlement Deferred net, four times a banking day Real-time, prefunded joint account at the Fed Real-time gross, Fed master accounts Real-time gross, Fed master accounts Message format Nacha fixed-width records ISO 20022 ISO 20022 ISO 20022 since 14 Jul 2025 Pull payments Yes (debits) No, Request for Payment only No, Request for Payment only No, drawdown reque

Dev
Interesse
dev.to

To Retry or Not to Retry: Safe Retry Logic with Exponential Backoff, Jitter and Idempotency Keys

Hồi trước team mình từng có một sự cố khá kinh điển: payment provider chập chờn khoảng 30 giây, và trong 30 giây đó service của bọn mình gửi 4 lần request charge tiền cho cùng một đơn hàng. Lý do là có 3 tầng cùng retry: SDK của client, service gọi API, và cả job queue phía sau. Không tầng nào sai nếu xét riêng, nhưng gộp lại thì thành thảm họa. Sau lần đó mình rút ra một điều: retry không phải tính năng "thêm vào cho chắc". Làm sai thì nó còn nguy hiểm hơn là không retry gì cả. Bài này mình chia sẻ cách mình đang làm retry trong production: khi nào nên retry, retry thế nào để không tự DDoS chính hệ thống của mình, và làm sao để retry an toàn với những request có side effect. Trước khi viết dòng code nào, cần trả lời hai câu hỏi: Lỗi này có phải lỗi tạm thời (transient) không? Timeout, 503 Service Unavailable, 429 Too Many Requests, ECONNRESET thì đáng retry. Còn 400, 401, 404, 422 thì retry 100 lần vẫn sai y như vậy. Request này có idempotent không? GET, PUT, DELETE theo chuẩn HTTP là idempotent. POST thì không. Retry một request POST /charges khi bị timeout là cách nhanh nhất để charge khách hai lần, vì timeout không có nghĩa là server chưa xử lý. Rất có thể server đã xử lý xong, chỉ có response là không về tới bạn. flowchart TD A[Request thất bại] --> B{Lỗi transient? timeout, 429, 502, 503, 504} B -- Không --> X[Fail ngay, không retry] B -- Có --> C{Request idempotent hoặc có Idempotency-Key?} C -- Không --> X C -- Có --> D{Còn retry budget?} D -- Không --> X D -- Có --> E[Chờ backoff + jitter] E --> F[Retry] Nguyên tắc của mình: mặc định là không retry, chỉ retry khi đã qua đủ cả ba điều kiện trên. Retry ngay lập tức gần như luôn là ý tưởng tồi. Server đang quá tải mà bạn bắn thêm request thì nó càng chết nhanh hơn. Exponential backoff giải quyết việc này: chờ 1s, 2s, 4s, 8s... Nhưng chỉ backoff thôi thì chưa đủ. Giả sử 10.000 client cùng bị lỗi lúc 10:00:00. Với backoff thuần, cả 10.000 client sẽ cùng retry lúc 10:00:01, rồi cùng lúc 10:00:03... Đây là hiện tư

Dev
Interesse
dev.to

CVE-2026-88779 — Citrix NetScaler SAML Memory Overflow, Actively Exploited, CISA KEV

A memory overflow in Citrix NetScaler's SAML handler is being actively exploited as a zero-day. CISA added CVE-2026-88779 to the Known Exploited Vulnerabilities catalog on October 4, 2026. CVE-2026-88779 (CVSS 4.0: 8.7) — Unauthenticated memory overflow (CWE-119) triggered by malicious SAML requests. Crashes the appliance's authentication service, denying VPN and SSO access to the entire organization. Citrix confirms DoS; Norway's NSM initially reported potential RCE — scope remains contested. If either returns results and you're below the fix versions, patch now. Fixed in: 14.1-73.41 (14.1 track) 13.1-64.28 (13.1 track) 14.1-73.41 FIPS / 13.1-37.282 (FIPS/NDcPP) Kevin Beaumont observed exploitation on honeypots running fully patched versions — the exploit may bypass the previous patch batch. Immediate actions: Patch to fixed version Apply Citrix Global Deny List signatures as interim mitigation Check for appliance crashes during the zero-day window Run compromise assessment on any internet-exposed SAML-enabled appliance Full analysis: https://threataft.com/articles/netscaler-saml-memory-overflow-cve-2026-88779

SegurançaInfra
Interesse
dev.to

Best practices for implementing LLM access controls and monitoring

The question Teams ask a version of the same thing: we wired an LLM to tools, it works, what do we actually have to build before we ship it. This article answers that with the concrete ordering and the failure modes, not with a maturity model. An AI agent is a model that can emit actions. The model itself is stateless text generation. The security problem starts at the boundary where generated text becomes a tool invocation, a database query, a file read, an HTTP request. That boundary is where you own the risk. The model will produce whatever token sequence is most probable given its context. It has no concept of your authorization model. If your handler executes what the model emits, the model is effectively your authorization layer, and it is not one. Three things go wrong repeatedly. Confused deputy. The agent runs with the credentials of the service hosting it. A user who is only allowed to read triggers a tool that writes. The tool does not know the difference because the identity it sees is the service account. Scope creep through arguments. The tool is permitted, the identity is permitted, but the argument is not. A search tool called with a filter that reaches a tenant it should not. A file tool called with a path that escapes the intended directory. Silent success. The call was blocked, or should have been, and nothing recorded why. Weeks later nobody can distinguish a denied attack from a broken integration, so the block gets removed to make the dashboard green. None of this requires a novel exploit. It requires a tool call that was authorized at the wrong granularity. Put the decision in the request path, before execution, and make it ordered. Identity. Resolve who is asking. Not the service account. The end user or the workload that originated the request, propagated through the agent. Tool. Is this identity allowed to invoke this tool at all. Resource. Is this tool allowed to touch this resource for this identity. Arguments. Does this specific argument

SegurançaDevIA
Interesse
dev.to

The Verifier Design Playbook: How to Build RLVR Gyms That Models Can't Game

In traditional machine learning, your loss function is a clean mathematical equation: mean squared error, cross-entropy, or cosine distance. The math is simple, deterministic, and impossible for the model to corrupt. In Reinforcement Learning with Verifiable Rewards (RLVR), your verifier is your loss function. The verifier is the Python script, Docker container, or compiler that runs after every rollout, inspects what the model just did, and hands back a numerical reward. If that verifier has a single logical loophole, the model will find it within two hundred training steps. It will exploit that loophole with relentless mathematical precision, report a 100% training reward, and produce a checkpoint that is completely useless in production. Over the past year, engineering teams deploying RL post-training across coding, chip design, spreadsheets, and databases discovered that building the training harness is only 20% of the battle. The other 80% is verifier defense engineering. Below is the pragmatic, battle-tested playbook for designing deterministic RLVR verifiers: how to structure the task contract, how to layer defense-in-depth, and how to protect your runs against the real-world exploits that derail production post-training. Start here Master the 3-layer verifier architecture (Gate, Oracle, Risk Scorer), prevent active inaction (the Zapier trap) and canned refusals, remove leftover caches and artifacts from rollout environments, apply asymmetric risk matrices, and run tamper-proof canary tests. RLVR (Verifiable RL): Reinforcement learning where policy updates are driven strictly by programmatic outcomes (compilers, unit tests, linters, API response codes) rather than human opinion. Fail-Closed Gate: A mandatory validation step that halts execution and awards exactly 0.0 reward if safety, protocol, or state-change invariants are breached. Active Mutation Verification: Confirming that an agent actually caused verified state changes (HTTP 200 writes, DB row deltas)

IADev
Interesse
dev.to

Secure Self-Hosted n8n on AWS: The 2026 Hardening Checklist

A friend messaged me last month. He had spun up self-hosted n8n on a cheap cloud box over a weekend, wired it to Stripe, his Postgres, Slack, and a couple of Google APIs, and it was humming along beautifully. Then he asked the question that made my stomach drop: "Wait, is port 5678 supposed to be open to the whole internet?" It was. He had followed a popular tutorial. The tutorial told him to publish 5678:5678 in his Docker Compose file, skip the encryption key, and get on with building workflows. It worked on the first try. That is exactly the problem. Here is the thing nobody says loudly enough: people treat n8n as an automation tool. It is really a credential aggregator. One instance can hold the keys to Stripe, your database, Slack, Google, HubSpot, and a dozen other services. Compromise the n8n box and you do not get one API key. You get all of them, at once. In 2026 that stopped being theoretical. This is not fearmongering. n8n had a genuinely bad year for security, and a lot of it hit self-hosted instances specifically: Multiple critical CVEs, including a couple rated CVSS 10.0 (sandbox escape leading to full server takeover). Leaked API tokens exposing live instances to credential theft. Weak encryption keys recovered from public artifacts. Researchers found internet-exposed instances running with known weak keys, which means the "encryption" protecting stored credentials was effectively decorative. The one I want to anchor on, because it is clean and easy to understand, is CVE-2026-65589. Type: information disclosure (CWE-532, sensitive data written to records). Affected: n8n before 1.123.64 on the 1.x line, fixed in 1.123.64. The 2.x line is patched separately (fixed in 2.29.8), so check your major version and upgrade to the fixed release for whichever line you run. What happens: when you pass credentials as custom HTTP headers inside certain LLM sub-nodes (OpenAI, Anthropic, and others), n8n masks them in the UI but writes the plaintext API key straight i

SegurançaInfraDev
Interesse
dev.to

AI Agent Governance: A Practical Guide for Agents That Work in Production

AI agent governance is the set of rules, checks, and controls that decide what an autonomous agent is allowed to do, see, and act on once it's live. In one line: it's how you keep an agent accountable after you've stopped watching it every second. TL;DR: If your agent only chats, governance can wait. If it books, refunds, updates records, or touches a real system, governance isn't optional, it's the thing standing between "cool demo" and "expensive incident." Here's a real one. In early 2024, Air Canada's support chatbot told a customer he could apply for a bereavement fare after his flight, and gave him a made-up policy to back it up. Air Canada tried to argue the chatbot was "a separate legal entity" responsible for its own words. A Canadian tribunal didn't buy it. The airline had to honor the refund and pay damages. Nobody had reviewed what the bot was allowed to promise. That's the whole problem in one paragraph. The agent wasn't malicious. It wasn't even that badly built. Nobody had drawn a line around what it could say and do, and when it crossed that line, there was no system catching it before the customer did. Two years ago, most "AI in production" meant a model scoring leads or flagging fraud. A human looked at the output before anything happened. That's not true anymore. Agents today book calendar slots, issue refunds, write and merge code, update CRM records, and call other agents to finish the job. They act first and get reviewed later, if at all. When something breaks, it's not a wrong prediction sitting in a dashboard. It's a wrong action that already happened somewhere. That shift is why governance built for predictive ML doesn't hold up here. You can validate a model once and monitor for drift. You can't validate an agent once and call it done, because the same agent can behave differently tomorrow based on a prompt change, a tool update, or a model version bump it didn't even ask for. Strip away the framework language and governance comes down to t

IA
Interesse
dev.to

Production AI & LLM Pipelines: Guardrails, Streaming Resilience, and Cost-Aware Fallbacks

Moving generative AI features from prototype scripts to mission-critical SaaS production requires far more than wrapping an OpenAI or Anthropic API client. Upstream API timeouts, rate-limit spikes, context window overflows, and malformed JSON outputs cause cascading UI crashes if unhandled. Here is an architectural playbook for building streaming-resilient LLM pipelines with structural JSON guardrails, dynamic model fallbacks, and token budget safety nets. Deploying Large Language Models into enterprise SaaS platforms introduces failure modes never encountered in traditional REST microservices. When upstream LLM providers suffer transient latency spikes, HTTP 429 rate limits, or produce hallucinated schema structures, your application backend must maintain strict availability SLAs. Integrating generative AI features via synchronous inline API calls exposes SaaS platforms to three critical operational risks: Non-Deterministic Latencies: Inference responses can span anywhere from 800ms to 30 seconds, causing web server socket timeouts and user experience degradation. Upstream Outages and Rate Limiting: Single-vendor dependence means an upstream outage or sudden tenant spike instantly breaks all AI capabilities across your product. Schema Drift & Unstructured Outputs: Prompt completion models occasionally produce invalid JSON formats, breaking downstream application parser logic and triggering unhandled runtime exceptions. A production-ready LLM orchestration layer wraps model provider SDKs in an abstraction client featuring automated circuit breaking, schema validation retries, and dynamic model tier fallback routing. If the primary model endpoint (e.g., Claude 3.5 Sonnet) exceeds a latency budget or throws a transient HTTP error, the pipeline immediately reroutes the execution to a secondary provider or smaller, faster model tier (e.g., GPT-4o-mini or Llama 3) without failing the client request. // Production-Grade Resilient LLM Invocation Engine (TypeScript) import

IADev
Interesse
dev.to

PostgreSQL Connection Pooling Misconceptions: Why PgBouncer Transaction Mode Breaks Your ORM and What to Do About It

--- title: "PgBouncer Transaction Mode: Why Your ORM Is Silently Breaking" published: true description: "PgBouncer transaction mode silently breaks prepared statements, advisory locks, and SET LOCAL. Here are the exact mitigations and pool sizing formula that prevent exhaustion without over-provisioning." tags: postgresql, architecture, api, performance canonical_url: https://mvpfactory.co/blog/pgbouncer-transaction-mode-orm --- ## What You Will Learn By the end of this article you will know exactly which ORM features break silently under PgBouncer transaction mode, how to fix each one at the driver layer, and how to size your pool correctly using a formula derived from production data. No hand-waving — concrete configuration for Hibernate, SQLAlchemy, and Prisma. ## Prerequisites - A running PostgreSQL instance behind PgBouncer (or planning to add one) - Familiarity with at least one of: Hibernate/JPA, SQLAlchemy, or Prisma - Basic understanding of connection pooling concepts --- ## The Trap Every Team Falls Into A team hits connection exhaustion at scale, adds PgBouncer in transaction mode, ships it, and watches mysterious bugs appear two weeks later in staging. Same failure sequence, different company. Every time. Transaction mode is the right default for high-concurrency backends. A PostgreSQL instance comfortable with 100 real connections can serve 10,000+ application-level "connections" because each server connection is held only for the duration of a single transaction. That is the promise. The cost: anything *session-scoped* disappears between statements. Here is the full picture: | Feature | Session mode | Transaction mode | |---|---|---| | Prepared statements (named) | Persisted | **Broken** | | `SET LOCAL` / `SET` variables | Persisted | **Broken** | | Advisory locks | Persisted | **Broken** | | Temporary tables | Persisted | **Broken** | | `LISTEN/NOTIFY` | Persisted | **Broken** | | Simple queries / unnamed stmts | Works | Works | Hibernate, SQLAlchemy,

Dev
Interesse
dev.to

Zero-Downtime Database Migrations: Shadow Tables, Dual-Writing, and Schema Expansion

Taking a mission-critical B2B SaaS database offline for a multi-hour ALTER TABLE migration is no longer acceptable for high-growth engineering teams. Long-running DDL statements acquire exclusive table locks, holding incoming web transactions hostage and causing catastrophic application outages. Here is an actionable operational guide to executing zero-downtime schema migrations using shadow tables, dual-write abstraction layers, and zero-lock schema phase expansion. In high-throughput relational database architectures, running a blocking ALTER TABLE ADD COLUMN or changing a column type on a table containing hundreds of millions of rows can trigger exclusive AccessExclusiveLocks. This blocks read and write queries, causes connection pool backpressure, and brings down web application layers. Scaling B2B SaaS applications requires decoupling schema evolution from application code deployments entirely. When an application attempts structural DDL modifications on relational databases like PostgreSQL or MySQL, the engine requests exclusive table locks. Under active write load, three major failure modes occur: Lock Queue Contention: A heavy DDL statement waiting for existing read queries to finish will block all subsequent incoming SELECT and UPDATE queries behind it in the lock queue, exhausting connection pools in seconds. Table Rewrite Overhead: Changing data types or setting default values without DEFAULT NULL on older engine versions forces full physical table rewrites, locking I/O channels for hours. Application-Database Version Mismatch: Deploying code that expects a new column before the database finished updating, or dropping a column while old application nodes are still serving traffic, causes unhandled HTTP 500 runtime exceptions. To safely migrate production tables containing tens of millions of rows, engineering teams employ the Expand-Contract Pattern, breaking a single risky database alteration into discrete, backward-compatible phases. Add new columns, in

InfraDev
Interesse
dev.to

Which prompt made that decision?

TL;DR: prompt in the repo, model pinned to an exact version (never an alias), retrieval index versioned, every change through the eval set, and the triple recorded with every decision. Pick any decision your AI feature took in production three weeks ago and ask a simple question: which prompt produced it? In most teams the honest answer is "probably the current one, unless someone changed it". That is not an answer you can give to an incident review, to a customer, or to an auditor. An AI feature's behaviour depends on more than its code. The prompt decides how the model is instructed. The model decides how those instructions are interpreted. The retrieval index decides what context the model sees. Change any of the three and the same input can produce a different decision. In many systems none of the three goes through a release. The prompt lives in a database row or an admin panel, edited directly in production. The model is referenced by an alias such as "latest", and the provider moves that alias to a new version on its own schedule. The index is rebuilt by a nightly job. Nobody breaks anything, yet behaviour drifts, and when someone asks why, there is nothing to compare against. The fix is not a new tool. It is the release discipline we already apply to code, extended to the parts that change behaviour most. The prompt is code. It lives in the repository, goes through review, has a version and ships with a release. The model is a dependency: pin the exact version identifier the provider exposes, never the alias, and upgrade it deliberately, like any other dependency. The retrieval index gets a version too, tied to the documents and the embedding model that built it. Every change to any of the three goes through the same gate: run the eval set against the new combination, compare it with the one in production, then release. Rollback means redeploying the previous combination, not retyping a prompt from memory or hoping the provider still serves the old model und

IADev
Interesse
dev.to

Secure SMS OTP Login: Rate Limits, Lockouts, and Replay Defense

An SMS provider can deliver and verify a code, but it cannot see enough of your application to decide whether a request is abusive. Short answer: design a secure SMS OTP login flow with per-user, per-IP, and per-device limits in front of every send; give each challenge a short expiry and an attempt ceiling; consume it exactly once; temporarily lock repeated failures; and enforce country policy before spending a send. Provider selection comes after those controls, not before them. For a healthtech marketplace notifying a seller about a new order, keep that notification outside the login challenge. An order event may justify a message, but it must never create, extend, or implicitly verify an authentication challenge. The operational invariant is blunt: no unauthenticated caller gets an unmetered path from an HTTP request to a billable SMS. Start the incident review with a bounded exercise: one account receives repeated OTP requests from rotating IP addresses, then the correct code is submitted twice. No invented outage or benchmark is needed to expose the design error. If the only alert is a provider dashboard showing message volume, it arrives after the application has already surrendered control. I distrust that dashboard as the primary signal because it cannot answer the useful questions. Which user, device, IP, and destination country crossed policy? Did suppression prevent a send? Was a challenge accepted after it had already been consumed? The page should fire on an application-owned decision, such as a sharp rise in denied sends or locked challenges, with dimensions that let the responder distinguish a broken client release from a distributed attack. Provider delivery status is supporting evidence. The postmortem invariant is therefore narrower than “add rate limiting.” Every state transition must be attributable and atomic: requested, denied, issued, failed, locked, expired, or consumed. Count denied requests as well as successful sends. Otherwise an attacker

SegurançaDev
Interesse
dev.to

Autoscaling doesn't save you at 30,000 requests per second — your dependencies do

There's a comfortable story about peak traffic: load goes up, the autoscaler notices, pods multiply, everyone keeps their evening. I've watched that story hold, and I've watched it fail in a specific and instructive way — the autoscaler worked perfectly and the platform degraded anyway. Running transaction paths at sustained peaks in the tens of thousands of requests per second teaches you that horizontal scaling is the easy half of the problem. The hard half is that everything your new pods talk to did not scale, and now there are more of them asking. Scale-up triggers. Pods go from 12 to 40 in about ninety seconds. Each one opens its configured pool of 20 database connections on startup. The database's connection limit is 500. Twelve pods needed 240 connections and everything was fine. Forty pods want 800. The database starts refusing connections, the pods that can't connect fail their readiness probes, the orchestrator restarts them, they try to connect again, and you have built a very efficient machine for denying yourself service. The autoscaler, meanwhile, sees rising latency and scales up further. The dashboards looked bizarre: CPU low, memory low, replica count healthy, error rate vertical. Autoscaling converts a capacity problem into a concurrency problem on whatever you depend on. If that dependency is a fixed-size resource — a connection limit, a license seat count, a rate-limited upstream, a legacy system with a thread pool — scaling out makes things worse, not better, and it does so fast. The fix is to stop thinking about per-pod configuration and start thinking about a global budget: pool_size_per_pod × max_replicas ≤ dependency_limit × safety_factor With a 500-connection database, 0.8 safety factor (leave headroom for migrations, admin sessions, the other service nobody told you about), and a 40-replica ceiling: pool_size ≤ (500 × 0.8) / 40 = 10 Then pin both halves so neither drifts: apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler spec: minR

InfraDev
Interesse
dev.to

GPT-6 Astra on Bedrock: the endpoint decides what you audit

GPT-6 Astra reached GA on Amazon Bedrock on September 8, 2026 with a number everyone repeated, a 1,050,000-token context window, and an architectural decision almost nobody mentioned: the model is served by two distinct endpoints, bedrock-runtime and bedrock-mantle, and they do not offer the same guarantees. Picking one is not an SDK preference. It is choosing, inside the same request, between explicit prompt caching and invocation logging, because the model card does not give you both on the same path. The model card is more informative than the announcement. openai.gpt-6-astra has a 1,050,000-token input window, a 128,000-token output ceiling and an April 30, 2026 knowledge cutoff. Input accepts text and image; output is text only, anyone expecting image or audio generation from the same model ID will hit a wall. EOL no sooner than September 8, 2027, with a legacy period of at least 6 months: that is a one-year contractual floor for planning migration, and it is the kind of fact that belongs in your ADR, not in your slide. The API surface is smaller than it looks. On bedrock-runtime, the model answers on Converse, Responses and Chat Completions, and not on InvokeModel. If your internal wrapper standardized everything on InvokeModel to get a single instrumentation point, it does not call Astra. On bedrock-mantle, only Responses and Chat Completions, served at /openai/v1/responses and /openai/v1/chat/completions. One service tier. Standard only. Priority, Flex and Reserved are all listed as unsupported. There is no reserved throughput to hold peak latency, and no Flex tier to soften an overnight batch. Your whole workload shares the same pay-per-token queue, and your only control over tail latency is which Region you pick. The same model ID crosses two control planes. The left column gives you Guardrails and invocation logs; the right one gives you explicit caching and server-side tools, and disappears from the log. The inference profile you name decides which Regio

IAInfraDev
Interesse
dev.to

Build a RAG Evaluation Set Before You Ship Your AI Feature

Build a small evaluation set before you ship a RAG feature. That means 50 to 100 real questions, each with an expected answer and the source document that should support it. Score retrieval and answer quality separately, and run the set on every change to chunking, embeddings, prompts or models. Without it, every tweak is a guess. You change the chunk size and try three questions in a playground. It "feels better," so you ship it, and the regression stays hidden until a customer finds it. Most RAG features get tested the same way: someone types questions they already know the answer to. That set is tiny, leans toward easy cases and is different every time. An evaluation set fixes three things: It is stable. You ask the same questions on every run, so you can compare versions. It is honest. Real questions come with typos, vague wording and topics your docs do not cover. It shows where the failure is. When an answer is wrong, you can tell whether retrieval missed the right chunk or the model mishandled a good one. Do not write the questions yourself from the docs. You will use the docs' own wording, and that makes retrieval look better than it really is. Good sources: Support tickets and live chat transcripts Sales call notes ("does it integrate with X?") Internal channels where people ask the ops or product team things Search logs from your existing help center Beta users, if you have them Aim for a mix: Simple lookups with one clear source Questions that need two documents combined Questions worded very differently from the docs Questions your corpus cannot answer, where the correct behavior is "I don't know" A few adversarial cases: an outdated policy, conflicting docs, a prompt injection attempt The unanswerable questions matter more than most teams expect. A RAG system that confidently makes up an answer is worse than one that admits a gap. Why 50 to 100? Below 50, one flaky question moves your score too much. Above 100, labeling becomes a chore and nobody keeps

IADev
Interesse
dev.to

pull_request_target in the wild: 60 public workflows, 6 exploitable, and the fixes that actually work

pull_request_target is the GitHub Actions trigger behind a steady stream of and runs it. We ship a rule for exactly that combination. Before trusting it, we measured it Three ingredients, all of them needed: the pull_request_target trigger; a checkout of the pull request's own code (ref: ${{ github.event.pull_request.head.sha }} or .head.ref); a step that executes that code: install scripts, a build, the test suite. With all three, anyone who can open a pull request runs their code with your We sampled 30 public workflows that use pull_request_target. The rule fired on On review, 8 of the 15 were false: 7 used environment:, the mitigation GitHub documents: the job waits for a human to approve it before any contributor code runs. Among them were dbt-labs and puppetlabs, who had it right and had commented it in their own files. 1 declared allow-unsafe-pr-checkout: true and ran its scripts from a second, trusted checkout of the default branch kept in a separate folder (cpprefjp/site). The contributor's code is read as data, never executed. Had we opened issues from that first run, we would have told seven well-known A new random sample of 30 public workflows, one per repository. 6 of them Reading each one by hand: 3 never run it with privileges. The privileged trigger only fires when the pull request is closed, the checkout is the base branch, or the head branch only appears in a concurrency group name. 2 are gated by a maintainer. In ecmwf's cfgrib and thermofeel, a pull request from a fork only runs once a maintainer adds an approved-for-ci label. 1 is exploitable. It checks out the pull request's code, runs dotnet build and the tests on it, and grants the token contents: write and pull-requests: write. Anyone who opens a pull request can push to that repository. We are not naming it. That last one had written allow-unsafe-pr-checkout: true, and our rule stayed After the cpprefjp case we had treated that line as a actions/checkout v7 requires it precisely so that Acr

SegurançaDev
Interesse
dev.to

Why Math.random() Is the Wrong Tool for Passwords (and What to Use Instead)

If you've ever written Math.random().toString(36).slice(2) to generate a "random" token, this post is for you. It works, it looks random, and it's the wrong tool for anything security-related. Here is why, and what to use instead. What Math.random() actually is The ECMAScript spec only asks for an "approximately uniform" distribution. It makes no security guarantees at all, and leaves the algorithm up to each engine. V8 (Chrome, Node.js) uses xorshift128+, which is fast and statistically decent, but it is not designed to resist an attacker. The practical consequence: with xorshift128+, the internal state can be reconstructed from a small number of consecutive outputs, and once an attacker has the state, every future output is predictable. This has been demonstrated publicly with off-the-shelf constraint solvers. If you use Math.random() to produce a reset token, a session ID, or a password, an attacker who can observe a few outputs from the same generator may be able to predict the rest. For a particle animation or shuffling a playlist, none of this matters. For anything where someone benefits from guessing the next value, it does. What to use instead: crypto.getRandomValues() const bytes = new Uint32Array(4); It works in all modern browsers and in Node.js (globalThis.crypto, or require('node:crypto').webcrypto in older versions). The trap: modulo bias // DON'T The fix is rejection sampling: throw away the values that fall in the uneven tail. function secureRandomInt(min, max) { range that fits in 32 bits I checked this against 600,000 simulated six-sided die rolls: each face landed within about 0.1 percentage points of the ideal 16.67%, with no face favored. A complete example: a password generator function generatePassword(length = 16) { // One guaranteed character from each set console.log(generatePassword(16)); // e.g. "T07@iRz!Sh+4yiAT" Entropy check: the combined pool has 80 characters (26 + 26 + 10 + 18), so each character adds log2(80) ≈ 6.32 bits and a 16-c

SegurançaDev
Interesse
dev.to

Como garantir que um Pix seja creditado exatamente uma vez

Todo sistema que recebe Pix depende de uma notificação assíncrona do PSP: o webhook. Em produção, esse webhook chega duplicado quando o PSP não recebe o 200 a tempo, chega atrasado, chega fora de ordem (a devolução antes do crédito) e às vezes não chega. Mesmo assim, cada centavo precisa ser creditado exatamente uma vez, e no fim do dia o saldo interno tem que bater com o extrato do PSP. Montei um laboratório para provar isso, o PixLab: um PSP falso que injeta essas falhas de propósito, com seed, e um recebedor de referência que precisa sobreviver a todas. Seguem as cinco decisões que fazem a diferença. if O erro clássico: if (!pagamentoJaExiste(e2eId)) { // duas threads passam aqui juntas... creditar(e2eId); // ...e as duas creditam } Com dois webhooks idênticos chegando no mesmo milissegundo, os dois SELECT respondem "não existe" antes de qualquer INSERT. A garantia tem que vir do banco: insert into webhook_inbox (source, event_key, payload) values ('PIX', :e2eId, :payload) on conflict (source, event_key) do nothing O endpoint grava, responde 200 e mais nada. No laboratório, 1.000 entregas simultâneas do mesmo webhook geram exatamente 1 crédito. O PSP reenvia quando o seu 200 demora. Então o endpoint não processa: valida a assinatura, grava na inbox e responde. Workers consomem a inbox com SELECT … FOR UPDATE SKIP LOCKED. Vários workers em paralelo, nenhum pegando o mesmo evento, e a transição de estado, o lançamento no ledger e o evento da outbox na mesma transação. Num teste de carga com 500 req/s e 30% de reentregas, o p99 do ack ficou em 16 ms. Se o webhook nunca chega, quem descobre? Um job consulta periodicamente GET /pix?inicio&fim, em janelas que se sobrepõem, e injeta cada Pix na mesma inbox. Como a inbox é idempotente, reler o mesmo Pix cem vezes é inofensivo. Existe um único caminho de entrada (webhook, consulta ativa, reparo da conciliação), e é isso que torna a garantia verdadeira em todos os casos. A devolução chegou antes do crédito? O evento volta

Dev
Interesse
dev.to

LeetCode Patterns: The Complete List of 20 to Master (With Examples)

The complete list of 20 LeetCode patterns. Each one carries the signal that identifies it in a problem statement, a code template you can reuse, and three practice problems on LeetCode. Pattern problem counts come from LeetCode's own topic tags. LeetCode has 4,073 problems. Nobody solves them all, and nobody needs to. The questions are generated from a much smaller set of reusable approaches. Learn to recognize those, and a problem you have never seen becomes a variation of one you have. Miss them, and every question feels new, which is why solving hundreds of problems at random produces so little. This guide covers all 20 patterns. For each one you get the cue that gives it away, why it works, a short template in Python, and three real LeetCode problems to practice on. The order is by what each pattern returns against LeetCode's actual problem distribution, so the earliest entries are the ones worth learning first. You will see these called LeetCode patterns, LC patterns, coding patterns, or DSA patterns. They are the same thing: a reusable approach that pairs an algorithmic technique with the data structure it runs on. A single LeetCode pattern is worth more than a hundred solved problems, because the pattern transfers and the solved problem does not. If you want the same 20 as a short reference instead, see the coding interview patterns catalog. If you want to train the recognition skill itself rather than read the list, see how to read a problem statement and name the pattern. Two Pointers Sliding Window Modified Binary Search Tree Depth First Search Tree Breadth First Search Island (Matrix Traversal) 0/1 Knapsack (Dynamic Programming) Top 'K' Elements Backtracking Subsets Bitwise XOR Fast & Slow Pointers Merge Intervals Monotonic Stack Topological Sort In-place Reversal of a Linked List Two Heaps Cyclic Sort K-way Merge Multi-threaded Problem counts are LeetCode topic-tag totals, pulled from LeetCode. A few patterns share a tag and two have no dedicated tag, wh

Dev
Interesse
dev.to

Your repo is not trusted context. What I changed after giving coding agents real repositories

I use coding agents across real repositories every day. I run a small security firm, and between audits and two kids there are never enough hours, so agents do a lot of the reading and the grunt work for me. The biggest mindset shift wasn't about which model to use. It was this: the repository is not automatically trusted context. When you ask an agent to "fix the failing test", it reads the README, the open issues, the test files, package.json, maybe the CI config. To you, that's your project. To an attacker, every one of those files is an input channel into something that can run commands on your machine. A README or an issue can contain instructions. Following instructions is the agent's whole job. One line buried in a doc ("before running the tests, also run this setup command") is prompt injection with a shell attached. A test can execute code. "Run the tests" means "run whatever the test files do". A package script can install more code. Install hooks run on install, and agents install dependencies all the time. A git hook can run before the commit you asked for. Config files are persistence. If the agent can write to your shell config, IDE settings, git hooks or CI workflows, one bad step survives the session. And the dependency the agent suggests might not even exist yet. Attackers register package names that models tend to hallucinate (people call it slopsquatting). @harsh2644 tested three AI coding tools for it this week if you want to see how often it happens. When we review agent systems, the failure is rarely the model saying something bad. It's untrusted text reaching an execution sink: a shell command, a package install, a file write outside the repo, a CI change, a network call. So I look at it like taint analysis in code review. Draw every path from something untrusted (an issue, a doc, a test, package metadata, generated code) to something that executes or persists. Then ask what stops it on each path. Usually the honest answer is "I'd have to noti

SegurançaDevIA
Interesse
dev.to

Advanced Privacy: A Practical Defense-in-Depth Guide

Privacy is not a product you install. It is a system of boundaries that prevents one disclosure from becoming a complete map of your life. No setup makes you invisible. A realistic privacy program does four things: reduces unnecessary collection; makes separate activities harder to correlate; limits the damage when a service or device is compromised; and gives you a tested path to recover. This guide is designed for ordinary people who want materially stronger privacy without turning daily life into a full-time security project. It also explains where common advice fails, especially around VPNs, SMS verification, virtual numbers, cloud backups, and identity compartmentalization. Scope: This is educational guidance, not legal advice. Border searches, telecommunications rules, identity requirements, and data-retention laws vary by jurisdiction. If your safety, liberty, immigration status, employment, or source protection is at stake, consult qualified local counsel or a digital-security specialist. Start with a threat model The 60-minute privacy sprint Build identity compartments Use an email architecture Separate payments and addresses Stop using your personal number everywhere Secure accounts and recovery Reduce device attack surface Protect communications Understand browsers, VPNs, and Tor Control the home network Minimize files, cloud copies, and backups Reduce public exposure Plan for home, travel, and checkpoints Prepare an incident-response sequence Implement the system in phases Buying privacy tools before defining the problem usually creates cost and complexity without meaningful protection. Start with one page and answer five questions. List the assets that must remain confidential, available, or authentic: conversations, location history, contacts, identity documents, funds, unpublished work, health records, account access, or a protected source. Separate data brokers, scammers, abusive acquaintances, employers, platform operators, thieves, litigants, and s

SegurançaMobile
Interesse
dev.to

Stored Procedures

Stored Procedures A deep-dive walkthrough of stored procedures — covering parameters and output parameters, plan caching and recompilation specific to procedures (and how this connects directly to this series' Execution Plans guide's parameter-sniffing discussion), error handling with TRY/CATCH and THROW, the genuine security benefits of permission abstraction, temp tables vs. table variables inside a procedure body, the stored-procedures-vs-dynamic-SQL-vs-ORM debate argued honestly from both sides, and how EF Core calls into procedures when raw LINQ-to-Entities isn't the right tool. Introduction What a Stored Procedure Actually Is Parameters: Input, Output, and Defaults Return Values vs. Output Parameters vs. Result Sets Plan Caching for Stored Procedures Recompilation: sp_recompile, WITH RECOMPILE, OPTION (RECOMPILE) Error Handling: TRY/CATCH and THROW Temp Tables vs. Table Variables Inside a Procedure Security: Permission Abstraction Stored Procedures and SQL Injection Stored Procedures vs. Dynamic SQL vs. ORM-Generated SQL Calling Stored Procedures from EF Core Versioning and Deployment Common Pitfalls Quick Reference Table Conclusion A stored procedure is a named, precompiled batch of SQL stored inside the database itself — parameterized, callable by name, and capable of containing genuine procedural logic (conditionals, loops, error handling) alongside ordinary queries. This guide goes deep on the mechanics that matter most in practice: how a procedure's plan is cached and why that interacts directly with this series' Execution Plans guide's parameter-sniffing discussion, the genuine, specific security benefit procedures provide beyond "they prevent SQL injection" (a claim worth examining precisely, since parameterized ad hoc queries prevent injection too), and an honest treatment of the stored-procedures-vs-ORM debate that doesn't pretend one side is simply correct. CREATE PROCEDURE GetOrdersByCustomer @CustomerId INT AS BEGIN SELECT Id, OrderDate, Total FROM

Dev
Interesse
dev.to

Hack The Box — Hercules Write-up | Advanced Active Directory & AD CS

Around three months ago, I successfully compromised Hercules, an Insane-rated Windows Active Directory machine on Hack The Box. Hercules was an interesting challenge because it required chaining multiple Active Directory weaknesses rather than relying on a single misconfiguration. The attack path required understanding how seemingly limited permissions could be chained together to obtain increasingly powerful access within the domain. Full Kill Chain: LDAP Injection → LFI → ASP.NET Cookie Forgery → NetNTLMv2 capture → Hash cracking → BloodHound recon → OU takeover → Disabled account resurrection → certificate abuse → Certificate impersonation → WinRM lateral movement → ForceChangePassword → Computer account takeover → RBCD + S4U2Self/U2U + S4U2Proxy → Domain Admin Key moments: LDAP blind injection: Wildcard wasn't filtered. Information is gathered character by character. Forged ASP.NET cookie: Forged an auth cookie as a privileged user via cryptography config leak. Certificate abuse: Smartcard Operators. Woke it up, grabbed the vulnerable template, then minted certificates for whomever I wanted. AD CS did all the work. RBCD-S4U2Self/S4U2Proxy: machine account had delegation rights to the DC. Synced its hash with the Kerberos session key, abused. S4U2Self/U2U/S4U2Proxy obtained a service ticket as a domain admin. Didn't touch their password once. WinRM: Imported the ticket. Full shell on the DC. Objective complete. Full Write-up I documented the complete methodology, enumeration process, exploitation steps, attack chain, and technical analysis in my full write-up on Medium. Read the full Hercules write-up on Medium: https://medium.com/@rafidahmed/chained-trust-a-full-compromise-of-htb-hercules-via-ldap-injection-credential-harvesting-and-c81a033c5dcc?sk=3c12b9f28b36557b946521975a3855cb The full article goes into significantly more detail, including the complete attack path and the techniques used to compromise the machine. Thanks to Hack The Box for creating such a c

SegurançaDev
Interesse
dev.to

Safely Running AI-Generated Code in Node.js: `vm` vs `worker_threads` vs V8 Isolates

With the rise of autonomous AI agents and code-interpreting LLM features, Node.js backends are increasingly required to execute code generated on the fly. However, running arbitrary user or AI code inside a Node.js process is dangerous. A single malicious or hallucinated script can read environment variables (process.env), spawn OS processes (child_process), freeze the event loop with infinite loops, or crash your entire server by exhausting heap memory. In this post, we’ll analyze the three primary methods for executing isolated code in Node.js, why built-in modules fail at security, and how to implement true V8 heap sandboxing. vm Module: Great for Context, Terrible for Security Node.js ships with a built-in vm module that allows compiling and running code within a synthetic context. import vm from 'node:vm'; const context = { x: 2 }; vm.createContext(context); // Looks sandboxed, but IS NOT SECURE! vm.runInContext('x += 40;', context); The Node.js documentation explicitly states: "The vm module is not a security mechanism. Do not use it to run untrusted code." Because the context objects inside vm still inherit from the host process's standard prototypes, untrusted code can escape the sandbox via constructor chain navigation: // Exploiting Node.js vm to execute host OS commands const code = ` this.constructor.constructor('return process')().mainModule.require('child_process').execSync('whoami'); `; vm.runInContext(code, context); // Executed on your host machine! worker_threads: Good for Offloading, Weak for Isolation Node.js worker_threads move execution off the main event loop onto a separate thread. import { Worker } from 'node:worker_threads'; const worker = new Worker('./worker-script.js', { workerData: { code: 'console.log("Hello from worker");' } }); Pros: Non-blocking. If the guest script runs an infinite loop, the main event loop remains responsive. You can also destroy the thread via worker.terminate(). Cons: High memory footprint (each worker instantia

DevSegurança
Interesse
dev.to

CVE-2026-41264: How a Regex Let Prompts Run Code in Flowise

import pandas as np, os as pandas pandas.system("xcalc") Those two lines are the whole bypass in CVE-2026-41264, a CVSS 9.8 bug in Flowise, the open source drag-and-drop builder for LLM apps. Flowise's CSV Agent asked a model to write pandas code, checked the code with a regex, and ran it on the server. The regex was meant to stop any import other than pandas or numpy. It looked at the first module name after import and stopped there. Alias os as pandas and the check passes. The bug is worth studying because of what happened after it was reported. The fix in 3.1.0 was a stricter regex. Over the next three months the validator grew to 390 lines, picked up five more CVEs, and in June Flowise deleted the feature. If you build or test anything that runs model-generated code, that history is the lesson. Trend Micro's Zero Day Initiative reported the bug as ZDI-CAN-29411. The researchers credited are Dre Cura and Nicholas Zubrisky of TrendAI Research. Their analysis is published in full in the Flowise advisory GHSA-3hjv-c53m-58jj. The flow inside CSV_Agents.run(), as the advisory quotes it: Load the uploaded CSV in Pyodide and extract column names and dtypes with pandas. Fill a prompt template with those dtypes and the user's question. The template ends with a "Security:" paragraph telling the model not to use import, exec, eval, open, os or subprocess. Take the model's reply, strip Markdown fences, and store it as pythonCode. Run validatePythonCodeForDataFrame(pythonCode), a loop over 34 forbidden regexes. Execute import pandas as pd\n plus pythonCode with pyodide.runPythonAsync(). Step 2 is a request to the model, not a control. Step 4 is the only real check, and step 5 is where it fails. An unauthenticated attacker reaches all of it because /api/v1/prediction/ sits on Flowise's WHITELIST_URLS. The ZDI proof of concept puts a prompt injection in the question field asking the model to reply with the payload above. The advisory says it was tested against Llama 3.2 in Olla

SegurançaDevIA
Interesse