{"id":18422531,"url":"https://github.com/louis3797/xss-shield","last_synced_at":"2025-04-07T15:32:20.042Z","repository":{"id":146366854,"uuid":"616695539","full_name":"Louis3797/xss-shield","owner":"Louis3797","description":"A powerful middleware for securing your express.js applications against cross-site scripting (XSS) attacks","archived":false,"fork":false,"pushed_at":"2023-06-19T04:06:41.000Z","size":138,"stargazers_count":5,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T20:02:56.012Z","etag":null,"topics":["express-middleware","middleware","node","security","typescript","xss","xss-attacks","xss-filter","xss-sanitizer","xss-shield"],"latest_commit_sha":null,"homepage":"https://louis3797.github.io/xss-shield/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Louis3797.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-20T22:30:13.000Z","updated_at":"2024-05-09T18:08:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc7463b3-bd9f-4bc8-83dc-f6fe782b7ec4","html_url":"https://github.com/Louis3797/xss-shield","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Louis3797%2Fxss-shield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Louis3797%2Fxss-shield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Louis3797%2Fxss-shield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Louis3797%2Fxss-shield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Louis3797","download_url":"https://codeload.github.com/Louis3797/xss-shield/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247679741,"owners_count":20978112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express-middleware","middleware","node","security","typescript","xss","xss-attacks","xss-filter","xss-sanitizer","xss-shield"],"created_at":"2024-11-06T04:30:54.923Z","updated_at":"2025-04-07T15:32:20.034Z","avatar_url":"https://github.com/Louis3797.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n  \u003ch1\u003exss-shield\u003c/h1\u003e\n  \n  \u003cp\u003e\n   This package provides a middleware for Express.js that helps protect against cross-site scripting (XSS) attacks. It's built on top of the \u003ca href=\"https://www.npmjs.com/package/xss\"\u003exss module\u003c/a\u003e and is written in TypeScript.\n \n  \u003c/p\u003e\n  \n  \n\u003c!-- Badges --\u003e\n\u003cp\u003e\n  \u003ca href=\"https://github.com/Louis3797/xss-shield/graphs/contributors\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/contributors/Louis3797/xss-shield\" alt=\"contributors\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/last-commit/Louis3797/xss-shield\" alt=\"last update\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/Louis3797/xss-shield/network/members\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/forks/Louis3797/xss-shield\" alt=\"forks\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/Louis3797/xss-shield/stargazers\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/Louis3797/xss-shield\" alt=\"stars\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/Louis3797/xss-shield/issues/\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues/Louis3797/xss-shield\" alt=\"open issues\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/Louis3797/xss-shield/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/Louis3797/xss-shield.svg\" alt=\"license\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003c/div\u003e\n\n## Installation\n\nTo use this middleware, first install it using npm or yarn:\n```bash\nnpm install xss-shield\n```\n\nor \n\n```bash\nyarn add xss-shield\n```\n\n\n## Usage\nTo use this middleware in your Express.js application, simply require or import it and add it to your middleware stack:\n\n```ts\nconst express = require('express'); \nconst xssShield = require('xss-shield');\n\nconst app = express();\n\n// Add the middleware to the middleware stack\napp.use(xssShield());\n```\n\nYou can also pass options to the middleware to customize its behavior. See the [xss documentation](https://jsxss.com/en/options.html) for available options.\n\n```ts\nconst express = require('express'); \nconst xssShield = require('xss-shield');\n\nconst app = express();\n\n// Add the middleware to the middleware stack with options\napp.use(xssShield({\n  whiteList: {\n    a: ['href', 'title', 'target'],\n    img: ['src', 'alt'],\n  }\n}));\n```\n\n## License\nxss-shield is licensed under the MIT License. See LICENSE for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouis3797%2Fxss-shield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flouis3797%2Fxss-shield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouis3797%2Fxss-shield/lists"}