shield-llm 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +8 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -34,7 +34,7 @@ import "dotenv/config";
34
34
  import { Command, CommanderError } from "commander";
35
35
 
36
36
  // package.json
37
- var version = "0.5.0";
37
+ var version = "0.5.1";
38
38
 
39
39
  // src/credentials.ts
40
40
  import {
@@ -249,6 +249,13 @@ async function request(creds, method, path, body) {
249
249
  method,
250
250
  headers: {
251
251
  Authorization: `Bearer ${creds.apiKey}`,
252
+ // The /api/benchmark/* routes are dual-auth (browser session OR API
253
+ // key), so — unlike the API-key-only /api/cli/* routes — they are NOT
254
+ // exempt from the middleware's CSRF same-origin check. A non-browser
255
+ // client sends no Origin and is rejected with 403 "Invalid origin".
256
+ // Send Origin = the configured backend so the same-origin check passes.
257
+ // API-key auth carries no ambient-cookie CSRF risk, so this is safe.
258
+ Origin: new URL(creds.apiUrl).origin,
252
259
  ...body !== void 0 && { "Content-Type": "application/json" }
253
260
  },
254
261
  ...body !== void 0 && { body: JSON.stringify(body) }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shield-llm",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "AI chatbot security scanner — automated red teaming for LLMs",
5
5
  "type": "module",
6
6
  "publishConfig": {