cli-jaw 0.1.0
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.
- package/LICENSE +21 -0
- package/README.ko.md +411 -0
- package/README.md +416 -0
- package/README.zh-CN.md +411 -0
- package/dist/bin/cli-jaw.js +108 -0
- package/dist/bin/cli-jaw.js.map +1 -0
- package/dist/bin/commands/browser.js +241 -0
- package/dist/bin/commands/browser.js.map +1 -0
- package/dist/bin/commands/chat.js +878 -0
- package/dist/bin/commands/chat.js.map +1 -0
- package/dist/bin/commands/doctor.js +152 -0
- package/dist/bin/commands/doctor.js.map +1 -0
- package/dist/bin/commands/employee.js +70 -0
- package/dist/bin/commands/employee.js.map +1 -0
- package/dist/bin/commands/init.js +110 -0
- package/dist/bin/commands/init.js.map +1 -0
- package/dist/bin/commands/mcp.js +219 -0
- package/dist/bin/commands/mcp.js.map +1 -0
- package/dist/bin/commands/memory.js +105 -0
- package/dist/bin/commands/memory.js.map +1 -0
- package/dist/bin/commands/reset.js +109 -0
- package/dist/bin/commands/reset.js.map +1 -0
- package/dist/bin/commands/serve.js +75 -0
- package/dist/bin/commands/serve.js.map +1 -0
- package/dist/bin/commands/skill.js +232 -0
- package/dist/bin/commands/skill.js.map +1 -0
- package/dist/bin/commands/status.js +51 -0
- package/dist/bin/commands/status.js.map +1 -0
- package/dist/bin/postinstall.js +218 -0
- package/dist/bin/postinstall.js.map +1 -0
- package/dist/lib/mcp-sync.js +639 -0
- package/dist/lib/mcp-sync.js.map +1 -0
- package/dist/lib/quota-copilot.js +62 -0
- package/dist/lib/quota-copilot.js.map +1 -0
- package/dist/lib/upload.js +72 -0
- package/dist/lib/upload.js.map +1 -0
- package/dist/server.js +832 -0
- package/dist/server.js.map +1 -0
- package/dist/src/agent/args.js +66 -0
- package/dist/src/agent/args.js.map +1 -0
- package/dist/src/agent/events.js +328 -0
- package/dist/src/agent/events.js.map +1 -0
- package/dist/src/agent/spawn.js +646 -0
- package/dist/src/agent/spawn.js.map +1 -0
- package/dist/src/browser/actions.js +168 -0
- package/dist/src/browser/actions.js.map +1 -0
- package/dist/src/browser/connection.js +79 -0
- package/dist/src/browser/connection.js.map +1 -0
- package/dist/src/browser/index.js +4 -0
- package/dist/src/browser/index.js.map +1 -0
- package/dist/src/browser/vision.js +128 -0
- package/dist/src/browser/vision.js.map +1 -0
- package/dist/src/cli/acp-client.js +298 -0
- package/dist/src/cli/acp-client.js.map +1 -0
- package/dist/src/cli/commands.js +267 -0
- package/dist/src/cli/commands.js.map +1 -0
- package/dist/src/cli/handlers.js +405 -0
- package/dist/src/cli/handlers.js.map +1 -0
- package/dist/src/cli/registry.js +87 -0
- package/dist/src/cli/registry.js.map +1 -0
- package/dist/src/command-contract/catalog.js +36 -0
- package/dist/src/command-contract/catalog.js.map +1 -0
- package/dist/src/command-contract/help-renderer.js +39 -0
- package/dist/src/command-contract/help-renderer.js.map +1 -0
- package/dist/src/command-contract/policy.js +34 -0
- package/dist/src/command-contract/policy.js.map +1 -0
- package/dist/src/core/bus.js +17 -0
- package/dist/src/core/bus.js.map +1 -0
- package/dist/src/core/config.js +198 -0
- package/dist/src/core/config.js.map +1 -0
- package/dist/src/core/db.js +97 -0
- package/dist/src/core/db.js.map +1 -0
- package/dist/src/core/i18n.js +86 -0
- package/dist/src/core/i18n.js.map +1 -0
- package/dist/src/core/logger.js +14 -0
- package/dist/src/core/logger.js.map +1 -0
- package/dist/src/core/settings-merge.js +40 -0
- package/dist/src/core/settings-merge.js.map +1 -0
- package/dist/src/http/async-handler.js +6 -0
- package/dist/src/http/async-handler.js.map +1 -0
- package/dist/src/http/error-middleware.js +24 -0
- package/dist/src/http/error-middleware.js.map +1 -0
- package/dist/src/http/response.js +16 -0
- package/dist/src/http/response.js.map +1 -0
- package/dist/src/memory/heartbeat.js +106 -0
- package/dist/src/memory/heartbeat.js.map +1 -0
- package/dist/src/memory/memory.js +119 -0
- package/dist/src/memory/memory.js.map +1 -0
- package/dist/src/memory/worklog.js +154 -0
- package/dist/src/memory/worklog.js.map +1 -0
- package/dist/src/orchestrator/distribute.js +310 -0
- package/dist/src/orchestrator/distribute.js.map +1 -0
- package/dist/src/orchestrator/parser.js +118 -0
- package/dist/src/orchestrator/parser.js.map +1 -0
- package/dist/src/orchestrator/pipeline.js +343 -0
- package/dist/src/orchestrator/pipeline.js.map +1 -0
- package/dist/src/prompt/builder.js +531 -0
- package/dist/src/prompt/builder.js.map +1 -0
- package/dist/src/routes/browser.js +126 -0
- package/dist/src/routes/browser.js.map +1 -0
- package/dist/src/routes/quota.js +94 -0
- package/dist/src/routes/quota.js.map +1 -0
- package/dist/src/security/decode.js +23 -0
- package/dist/src/security/decode.js.map +1 -0
- package/dist/src/security/path-guards.js +62 -0
- package/dist/src/security/path-guards.js.map +1 -0
- package/dist/src/telegram/bot.js +469 -0
- package/dist/src/telegram/bot.js.map +1 -0
- package/dist/src/telegram/forwarder.js +93 -0
- package/dist/src/telegram/forwarder.js.map +1 -0
- package/package.json +80 -0
- package/public/css/chat.css +571 -0
- package/public/css/layout.css +350 -0
- package/public/css/markdown.css +270 -0
- package/public/css/modals.css +172 -0
- package/public/css/sidebar.css +225 -0
- package/public/css/variables.css +142 -0
- package/public/index.html +470 -0
- package/public/js/api.js +55 -0
- package/public/js/constants.js +119 -0
- package/public/js/features/appname.js +43 -0
- package/public/js/features/chat.js +242 -0
- package/public/js/features/employees.js +120 -0
- package/public/js/features/heartbeat.js +80 -0
- package/public/js/features/i18n.js +125 -0
- package/public/js/features/memory.js +85 -0
- package/public/js/features/settings.js +512 -0
- package/public/js/features/sidebar.js +88 -0
- package/public/js/features/skills.js +68 -0
- package/public/js/features/slash-commands.js +231 -0
- package/public/js/features/theme.js +40 -0
- package/public/js/locale.js +23 -0
- package/public/js/main.js +281 -0
- package/public/js/render.js +294 -0
- package/public/js/state.js +16 -0
- package/public/js/ui.js +172 -0
- package/public/js/ws.js +76 -0
- package/public/locales/en.json +180 -0
- package/public/locales/ko.json +180 -0
- package/public/theme-test.html +545 -0
- package/skills_ref/1password/SKILL.md +70 -0
- package/skills_ref/agents-sdk/SKILL.md +155 -0
- package/skills_ref/agents-sdk/references/callable.md +92 -0
- package/skills_ref/agents-sdk/references/codemode.md +207 -0
- package/skills_ref/agents-sdk/references/email.md +146 -0
- package/skills_ref/agents-sdk/references/mcp.md +154 -0
- package/skills_ref/agents-sdk/references/state-scheduling.md +164 -0
- package/skills_ref/agents-sdk/references/streaming-chat.md +178 -0
- package/skills_ref/agents-sdk/references/workflows.md +132 -0
- package/skills_ref/algorithmic-art/LICENSE.txt +202 -0
- package/skills_ref/algorithmic-art/SKILL.md +405 -0
- package/skills_ref/algorithmic-art/templates/generator_template.js +223 -0
- package/skills_ref/algorithmic-art/templates/viewer.html +599 -0
- package/skills_ref/apple-notes/SKILL.md +77 -0
- package/skills_ref/apple-reminders/SKILL.md +118 -0
- package/skills_ref/atlas/SKILL.md +99 -0
- package/skills_ref/brainstorming/SKILL.md +96 -0
- package/skills_ref/browser/SKILL.md +179 -0
- package/skills_ref/canvas-design/LICENSE.txt +202 -0
- package/skills_ref/canvas-design/SKILL.md +130 -0
- package/skills_ref/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/skills_ref/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/skills_ref/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/skills_ref/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/skills_ref/changelog-generator/SKILL.md +104 -0
- package/skills_ref/cloudflare-deploy/SKILL.md +207 -0
- package/skills_ref/codebase-orientation/SKILL.md +29 -0
- package/skills_ref/config-file-explainer/SKILL.md +26 -0
- package/skills_ref/context-compression/SKILL.md +265 -0
- package/skills_ref/context-compression/references/evaluation-framework.md +213 -0
- package/skills_ref/context-compression/scripts/compression_evaluator.py +658 -0
- package/skills_ref/data-structure-chooser/SKILL.md +26 -0
- package/skills_ref/debugging-checklist/SKILL.md +26 -0
- package/skills_ref/debugging-helpers/CREATION-LOG.md +119 -0
- package/skills_ref/debugging-helpers/SKILL.md +296 -0
- package/skills_ref/debugging-helpers/condition-based-waiting-example.ts +158 -0
- package/skills_ref/debugging-helpers/condition-based-waiting.md +115 -0
- package/skills_ref/debugging-helpers/defense-in-depth.md +122 -0
- package/skills_ref/debugging-helpers/find-polluter.sh +63 -0
- package/skills_ref/debugging-helpers/root-cause-tracing.md +169 -0
- package/skills_ref/debugging-helpers/test-academic.md +14 -0
- package/skills_ref/debugging-helpers/test-pressure-1.md +58 -0
- package/skills_ref/debugging-helpers/test-pressure-2.md +68 -0
- package/skills_ref/debugging-helpers/test-pressure-3.md +69 -0
- package/skills_ref/deep-research/.env.example +7 -0
- package/skills_ref/deep-research/README.md +246 -0
- package/skills_ref/deep-research/SKILL.md +106 -0
- package/skills_ref/deep-research/requirements.txt +2 -0
- package/skills_ref/deep-research/scripts/research.py +692 -0
- package/skills_ref/dependency-install-helper/SKILL.md +26 -0
- package/skills_ref/dev/SKILL.md +65 -0
- package/skills_ref/dev-backend/SKILL.md +61 -0
- package/skills_ref/dev-data/SKILL.md +76 -0
- package/skills_ref/dev-frontend/LICENSE.txt +177 -0
- package/skills_ref/dev-frontend/SKILL.md +42 -0
- package/skills_ref/dev-testing/LICENSE.txt +202 -0
- package/skills_ref/dev-testing/SKILL.md +96 -0
- package/skills_ref/dev-testing/examples/console_logging.py +35 -0
- package/skills_ref/dev-testing/examples/element_discovery.py +40 -0
- package/skills_ref/dev-testing/examples/static_html_automation.py +33 -0
- package/skills_ref/dev-testing/scripts/with_server.py +106 -0
- package/skills_ref/develop-web-game/SKILL.md +149 -0
- package/skills_ref/differential-review/.claude-plugin/plugin.json +10 -0
- package/skills_ref/differential-review/README.md +109 -0
- package/skills_ref/differential-review/commands/diff-review.md +21 -0
- package/skills_ref/differential-review/skills/differential-review/SKILL.md +220 -0
- package/skills_ref/differential-review/skills/differential-review/adversarial.md +203 -0
- package/skills_ref/differential-review/skills/differential-review/methodology.md +234 -0
- package/skills_ref/differential-review/skills/differential-review/patterns.md +300 -0
- package/skills_ref/differential-review/skills/differential-review/reporting.md +369 -0
- package/skills_ref/dispatching-parallel-agents/SKILL.md +180 -0
- package/skills_ref/doc-coauthoring/SKILL.md +375 -0
- package/skills_ref/docx/LICENSE.txt +30 -0
- package/skills_ref/docx/SKILL.md +481 -0
- package/skills_ref/docx/scripts/__init__.py +1 -0
- package/skills_ref/docx/scripts/accept_changes.py +135 -0
- package/skills_ref/docx/scripts/comment.py +318 -0
- package/skills_ref/docx/scripts/office/helpers/__init__.py +0 -0
- package/skills_ref/docx/scripts/office/helpers/merge_runs.py +199 -0
- package/skills_ref/docx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/skills_ref/docx/scripts/office/pack.py +159 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/skills_ref/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/skills_ref/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/skills_ref/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/skills_ref/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/skills_ref/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/skills_ref/docx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/skills_ref/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/skills_ref/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/skills_ref/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/skills_ref/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/skills_ref/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/skills_ref/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/skills_ref/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/skills_ref/docx/scripts/office/soffice.py +183 -0
- package/skills_ref/docx/scripts/office/unpack.py +132 -0
- package/skills_ref/docx/scripts/office/validate.py +111 -0
- package/skills_ref/docx/scripts/office/validators/__init__.py +15 -0
- package/skills_ref/docx/scripts/office/validators/base.py +847 -0
- package/skills_ref/docx/scripts/office/validators/docx.py +446 -0
- package/skills_ref/docx/scripts/office/validators/pptx.py +275 -0
- package/skills_ref/docx/scripts/office/validators/redlining.py +247 -0
- package/skills_ref/docx/scripts/templates/comments.xml +3 -0
- package/skills_ref/docx/scripts/templates/commentsExtended.xml +3 -0
- package/skills_ref/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/skills_ref/docx/scripts/templates/commentsIds.xml +3 -0
- package/skills_ref/docx/scripts/templates/people.xml +3 -0
- package/skills_ref/durable-objects/SKILL.md +186 -0
- package/skills_ref/durable-objects/references/rules.md +286 -0
- package/skills_ref/durable-objects/references/testing.md +264 -0
- package/skills_ref/durable-objects/references/workers.md +346 -0
- package/skills_ref/email-draft-polish/SKILL.md +24 -0
- package/skills_ref/error-message-explainer/SKILL.md +27 -0
- package/skills_ref/fal-image-edit/SKILL.md +249 -0
- package/skills_ref/fal-image-edit/scripts/edit-image.sh +199 -0
- package/skills_ref/figma-implement-design/SKILL.md +264 -0
- package/skills_ref/git-worktrees/SKILL.md +218 -0
- package/skills_ref/github/SKILL.md +210 -0
- package/skills_ref/gog/SKILL.md +116 -0
- package/skills_ref/goplaces/SKILL.md +52 -0
- package/skills_ref/himalaya/SKILL.md +257 -0
- package/skills_ref/hugging-face-cli/SKILL.md +186 -0
- package/skills_ref/hugging-face-cli/references/commands.md +954 -0
- package/skills_ref/hugging-face-cli/references/examples.md +374 -0
- package/skills_ref/hugging-face-evaluation/SKILL.md +651 -0
- package/skills_ref/hugging-face-evaluation/examples/.env.example +7 -0
- package/skills_ref/hugging-face-evaluation/examples/USAGE_EXAMPLES.md +382 -0
- package/skills_ref/hugging-face-evaluation/examples/artificial_analysis_to_hub.py +141 -0
- package/skills_ref/hugging-face-evaluation/examples/example_readme_tables.md +135 -0
- package/skills_ref/hugging-face-evaluation/examples/metric_mapping.json +50 -0
- package/skills_ref/hugging-face-evaluation/requirements.txt +20 -0
- package/skills_ref/hugging-face-evaluation/scripts/evaluation_manager.py +1374 -0
- package/skills_ref/hugging-face-evaluation/scripts/inspect_eval_uv.py +104 -0
- package/skills_ref/hugging-face-evaluation/scripts/inspect_vllm_uv.py +317 -0
- package/skills_ref/hugging-face-evaluation/scripts/lighteval_vllm_uv.py +303 -0
- package/skills_ref/hugging-face-evaluation/scripts/run_eval_job.py +98 -0
- package/skills_ref/hugging-face-evaluation/scripts/run_vllm_eval_job.py +331 -0
- package/skills_ref/hugging-face-evaluation/scripts/test_extraction.py +206 -0
- package/skills_ref/hugging-face-model-trainer/SKILL.md +718 -0
- package/skills_ref/hugging-face-model-trainer/references/gguf_conversion.md +296 -0
- package/skills_ref/hugging-face-model-trainer/references/hardware_guide.md +283 -0
- package/skills_ref/hugging-face-model-trainer/references/hub_saving.md +364 -0
- package/skills_ref/hugging-face-model-trainer/references/reliability_principles.md +371 -0
- package/skills_ref/hugging-face-model-trainer/references/trackio_guide.md +189 -0
- package/skills_ref/hugging-face-model-trainer/references/training_methods.md +150 -0
- package/skills_ref/hugging-face-model-trainer/references/training_patterns.md +203 -0
- package/skills_ref/hugging-face-model-trainer/references/troubleshooting.md +282 -0
- package/skills_ref/hugging-face-model-trainer/references/unsloth.md +313 -0
- package/skills_ref/hugging-face-model-trainer/scripts/convert_to_gguf.py +424 -0
- package/skills_ref/hugging-face-model-trainer/scripts/dataset_inspector.py +417 -0
- package/skills_ref/hugging-face-model-trainer/scripts/estimate_cost.py +150 -0
- package/skills_ref/hugging-face-model-trainer/scripts/train_dpo_example.py +106 -0
- package/skills_ref/hugging-face-model-trainer/scripts/train_grpo_example.py +89 -0
- package/skills_ref/hugging-face-model-trainer/scripts/train_sft_example.py +122 -0
- package/skills_ref/hugging-face-model-trainer/scripts/unsloth_sft_example.py +512 -0
- package/skills_ref/imagegen/SKILL.md +174 -0
- package/skills_ref/insecure-defaults/.claude-plugin/plugin.json +10 -0
- package/skills_ref/insecure-defaults/README.md +45 -0
- package/skills_ref/insecure-defaults/skills/insecure-defaults/SKILL.md +117 -0
- package/skills_ref/insecure-defaults/skills/insecure-defaults/references/examples.md +409 -0
- package/skills_ref/jupyter-notebook/SKILL.md +107 -0
- package/skills_ref/linear/SKILL.md +87 -0
- package/skills_ref/linter-fix-guide/SKILL.md +27 -0
- package/skills_ref/log-summarizer/SKILL.md +27 -0
- package/skills_ref/mcp-builder/LICENSE.txt +202 -0
- package/skills_ref/mcp-builder/SKILL.md +236 -0
- package/skills_ref/mcp-builder/reference/evaluation.md +602 -0
- package/skills_ref/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/skills_ref/mcp-builder/reference/node_mcp_server.md +970 -0
- package/skills_ref/mcp-builder/reference/python_mcp_server.md +719 -0
- package/skills_ref/mcp-builder/scripts/connections.py +151 -0
- package/skills_ref/mcp-builder/scripts/evaluation.py +373 -0
- package/skills_ref/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/skills_ref/mcp-builder/scripts/requirements.txt +2 -0
- package/skills_ref/memory/SKILL.md +129 -0
- package/skills_ref/modern-python/.claude-plugin/plugin.json +10 -0
- package/skills_ref/modern-python/README.md +66 -0
- package/skills_ref/modern-python/hooks/hooks.json +16 -0
- package/skills_ref/modern-python/hooks/setup-shims.bats +70 -0
- package/skills_ref/modern-python/hooks/setup-shims.sh +24 -0
- package/skills_ref/modern-python/hooks/shims/pip +27 -0
- package/skills_ref/modern-python/hooks/shims/pip-shim.bats +45 -0
- package/skills_ref/modern-python/hooks/shims/pip3 +27 -0
- package/skills_ref/modern-python/hooks/shims/pipx +41 -0
- package/skills_ref/modern-python/hooks/shims/pipx-shim.bats +64 -0
- package/skills_ref/modern-python/hooks/shims/python +26 -0
- package/skills_ref/modern-python/hooks/shims/python-shim.bats +53 -0
- package/skills_ref/modern-python/hooks/shims/python3 +26 -0
- package/skills_ref/modern-python/hooks/shims/uv +27 -0
- package/skills_ref/modern-python/hooks/shims/uv-shim.bats +47 -0
- package/skills_ref/modern-python/skills/modern-python/SKILL.md +333 -0
- package/skills_ref/modern-python/skills/modern-python/references/dependabot.md +43 -0
- package/skills_ref/modern-python/skills/modern-python/references/migration-checklist.md +141 -0
- package/skills_ref/modern-python/skills/modern-python/references/pep723-scripts.md +259 -0
- package/skills_ref/modern-python/skills/modern-python/references/prek.md +211 -0
- package/skills_ref/modern-python/skills/modern-python/references/pyproject.md +254 -0
- package/skills_ref/modern-python/skills/modern-python/references/ruff-config.md +240 -0
- package/skills_ref/modern-python/skills/modern-python/references/security-setup.md +255 -0
- package/skills_ref/modern-python/skills/modern-python/references/testing.md +284 -0
- package/skills_ref/modern-python/skills/modern-python/references/uv-commands.md +200 -0
- package/skills_ref/modern-python/skills/modern-python/templates/dependabot.yml +36 -0
- package/skills_ref/modern-python/skills/modern-python/templates/pre-commit-config.yaml +66 -0
- package/skills_ref/nano-banana-pro/SKILL.md +58 -0
- package/skills_ref/netlify-deploy/SKILL.md +233 -0
- package/skills_ref/notion/SKILL.md +304 -0
- package/skills_ref/notion-knowledge-capture/SKILL.md +56 -0
- package/skills_ref/notion-meeting-intelligence/SKILL.md +60 -0
- package/skills_ref/notion-research-documentation/SKILL.md +59 -0
- package/skills_ref/notion-spec-to-implementation/SKILL.md +58 -0
- package/skills_ref/obsidian/SKILL.md +81 -0
- package/skills_ref/openai-docs/SKILL.md +56 -0
- package/skills_ref/openhue/SKILL.md +112 -0
- package/skills_ref/pdf/SKILL.md +69 -0
- package/skills_ref/postgres/README.md +77 -0
- package/skills_ref/postgres/SKILL.md +129 -0
- package/skills_ref/postgres/connections.example.json +34 -0
- package/skills_ref/postgres/requirements.txt +1 -0
- package/skills_ref/postgres/scripts/query.py +262 -0
- package/skills_ref/pptx/LICENSE.txt +30 -0
- package/skills_ref/pptx/SKILL.md +232 -0
- package/skills_ref/pptx/editing.md +205 -0
- package/skills_ref/pptx/pptxgenjs.md +420 -0
- package/skills_ref/pptx/scripts/__init__.py +0 -0
- package/skills_ref/pptx/scripts/add_slide.py +195 -0
- package/skills_ref/pptx/scripts/clean.py +286 -0
- package/skills_ref/pptx/scripts/office/helpers/__init__.py +0 -0
- package/skills_ref/pptx/scripts/office/helpers/merge_runs.py +199 -0
- package/skills_ref/pptx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/skills_ref/pptx/scripts/office/pack.py +159 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/skills_ref/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/skills_ref/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/skills_ref/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/skills_ref/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/skills_ref/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/skills_ref/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/skills_ref/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/skills_ref/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/skills_ref/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/skills_ref/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/skills_ref/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/skills_ref/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/skills_ref/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/skills_ref/pptx/scripts/office/soffice.py +183 -0
- package/skills_ref/pptx/scripts/office/unpack.py +132 -0
- package/skills_ref/pptx/scripts/office/validate.py +111 -0
- package/skills_ref/pptx/scripts/office/validators/__init__.py +15 -0
- package/skills_ref/pptx/scripts/office/validators/base.py +847 -0
- package/skills_ref/pptx/scripts/office/validators/docx.py +446 -0
- package/skills_ref/pptx/scripts/office/validators/pptx.py +275 -0
- package/skills_ref/pptx/scripts/office/validators/redlining.py +247 -0
- package/skills_ref/pptx/scripts/thumbnail.py +289 -0
- package/skills_ref/property-based-testing/.claude-plugin/plugin.json +9 -0
- package/skills_ref/property-based-testing/README.md +47 -0
- package/skills_ref/property-based-testing/skills/property-based-testing/README.md +88 -0
- package/skills_ref/property-based-testing/skills/property-based-testing/SKILL.md +123 -0
- package/skills_ref/property-based-testing/skills/property-based-testing/references/design.md +191 -0
- package/skills_ref/property-based-testing/skills/property-based-testing/references/generating.md +204 -0
- package/skills_ref/property-based-testing/skills/property-based-testing/references/interpreting-failures.md +239 -0
- package/skills_ref/property-based-testing/skills/property-based-testing/references/libraries.md +130 -0
- package/skills_ref/property-based-testing/skills/property-based-testing/references/refactoring.md +181 -0
- package/skills_ref/property-based-testing/skills/property-based-testing/references/reviewing.md +209 -0
- package/skills_ref/property-based-testing/skills/property-based-testing/references/strategies.md +124 -0
- package/skills_ref/react-best-practices/AGENTS.md +2934 -0
- package/skills_ref/react-best-practices/README.md +123 -0
- package/skills_ref/react-best-practices/SKILL.md +136 -0
- package/skills_ref/react-best-practices/metadata.json +15 -0
- package/skills_ref/react-best-practices/rules/_sections.md +46 -0
- package/skills_ref/react-best-practices/rules/_template.md +28 -0
- package/skills_ref/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/skills_ref/react-best-practices/rules/advanced-init-once.md +42 -0
- package/skills_ref/react-best-practices/rules/advanced-use-latest.md +39 -0
- package/skills_ref/react-best-practices/rules/async-api-routes.md +38 -0
- package/skills_ref/react-best-practices/rules/async-defer-await.md +80 -0
- package/skills_ref/react-best-practices/rules/async-dependencies.md +51 -0
- package/skills_ref/react-best-practices/rules/async-parallel.md +28 -0
- package/skills_ref/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/skills_ref/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/skills_ref/react-best-practices/rules/bundle-conditional.md +31 -0
- package/skills_ref/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/skills_ref/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/skills_ref/react-best-practices/rules/bundle-preload.md +50 -0
- package/skills_ref/react-best-practices/rules/client-event-listeners.md +74 -0
- package/skills_ref/react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/skills_ref/react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/skills_ref/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/skills_ref/react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/skills_ref/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/skills_ref/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/skills_ref/react-best-practices/rules/js-cache-storage.md +70 -0
- package/skills_ref/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/skills_ref/react-best-practices/rules/js-early-exit.md +50 -0
- package/skills_ref/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/skills_ref/react-best-practices/rules/js-index-maps.md +37 -0
- package/skills_ref/react-best-practices/rules/js-length-check-first.md +49 -0
- package/skills_ref/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/skills_ref/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/skills_ref/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/skills_ref/react-best-practices/rules/rendering-activity.md +26 -0
- package/skills_ref/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/skills_ref/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/skills_ref/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/skills_ref/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/skills_ref/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/skills_ref/react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/skills_ref/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/skills_ref/react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/skills_ref/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/skills_ref/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/skills_ref/react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/skills_ref/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/skills_ref/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/skills_ref/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/skills_ref/react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/skills_ref/react-best-practices/rules/rerender-memo.md +44 -0
- package/skills_ref/react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/skills_ref/react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/skills_ref/react-best-practices/rules/rerender-transitions.md +40 -0
- package/skills_ref/react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/skills_ref/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/skills_ref/react-best-practices/rules/server-auth-actions.md +96 -0
- package/skills_ref/react-best-practices/rules/server-cache-lru.md +41 -0
- package/skills_ref/react-best-practices/rules/server-cache-react.md +76 -0
- package/skills_ref/react-best-practices/rules/server-dedup-props.md +65 -0
- package/skills_ref/react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/skills_ref/react-best-practices/rules/server-serialization.md +38 -0
- package/skills_ref/receiving-code-review/SKILL.md +213 -0
- package/skills_ref/registry.json +1493 -0
- package/skills_ref/render-deploy/SKILL.md +462 -0
- package/skills_ref/requesting-code-review/SKILL.md +105 -0
- package/skills_ref/requesting-code-review/code-reviewer.md +146 -0
- package/skills_ref/screen-capture/SKILL.md +162 -0
- package/skills_ref/security-best-practices/LICENSE.txt +201 -0
- package/skills_ref/security-best-practices/SKILL.md +86 -0
- package/skills_ref/security-best-practices/agents/openai.yaml +4 -0
- package/skills_ref/security-best-practices/references/golang-general-backend-security.md +826 -0
- package/skills_ref/security-best-practices/references/javascript-express-web-server-security.md +1158 -0
- package/skills_ref/security-best-practices/references/javascript-general-web-frontend-security.md +747 -0
- package/skills_ref/security-best-practices/references/javascript-jquery-web-frontend-security.md +678 -0
- package/skills_ref/security-best-practices/references/javascript-typescript-nextjs-web-server-security.md +1144 -0
- package/skills_ref/security-best-practices/references/javascript-typescript-react-web-frontend-security.md +990 -0
- package/skills_ref/security-best-practices/references/javascript-typescript-vue-web-frontend-security.md +791 -0
- package/skills_ref/security-best-practices/references/python-django-web-server-security.md +882 -0
- package/skills_ref/security-best-practices/references/python-fastapi-web-server-security.md +1036 -0
- package/skills_ref/security-best-practices/references/python-flask-web-server-security.md +705 -0
- package/skills_ref/security-ownership-map/LICENSE.txt +201 -0
- package/skills_ref/security-ownership-map/SKILL.md +206 -0
- package/skills_ref/security-ownership-map/agents/openai.yaml +4 -0
- package/skills_ref/security-ownership-map/references/neo4j-import.md +60 -0
- package/skills_ref/security-ownership-map/scripts/build_ownership_map.py +956 -0
- package/skills_ref/security-ownership-map/scripts/community_maintainers.py +544 -0
- package/skills_ref/security-ownership-map/scripts/query_ownership.py +483 -0
- package/skills_ref/security-ownership-map/scripts/run_ownership_map.py +200 -0
- package/skills_ref/security-threat-model/LICENSE.txt +201 -0
- package/skills_ref/security-threat-model/SKILL.md +81 -0
- package/skills_ref/security-threat-model/agents/openai.yaml +4 -0
- package/skills_ref/security-threat-model/references/prompt-template.md +255 -0
- package/skills_ref/security-threat-model/references/security-controls-and-assets.md +32 -0
- package/skills_ref/sentry/SKILL.md +123 -0
- package/skills_ref/skill-creator/SKILL.md +372 -0
- package/skills_ref/sora/SKILL.md +153 -0
- package/skills_ref/speech/SKILL.md +144 -0
- package/skills_ref/spotify-player/SKILL.md +64 -0
- package/skills_ref/static-analysis/.claude-plugin/plugin.json +8 -0
- package/skills_ref/static-analysis/README.md +65 -0
- package/skills_ref/static-analysis/agents/semgrep-scanner.md +71 -0
- package/skills_ref/static-analysis/agents/semgrep-triager.md +107 -0
- package/skills_ref/static-analysis/skills/codeql/SKILL.md +119 -0
- package/skills_ref/static-analysis/skills/codeql/references/diagnostic-query-templates.md +339 -0
- package/skills_ref/static-analysis/skills/codeql/references/language-details.md +207 -0
- package/skills_ref/static-analysis/skills/codeql/references/performance-tuning.md +111 -0
- package/skills_ref/static-analysis/skills/codeql/references/ruleset-catalog.md +63 -0
- package/skills_ref/static-analysis/skills/codeql/references/threat-models.md +44 -0
- package/skills_ref/static-analysis/skills/codeql/workflows/build-database.md +669 -0
- package/skills_ref/static-analysis/skills/codeql/workflows/create-data-extensions.md +536 -0
- package/skills_ref/static-analysis/skills/codeql/workflows/run-analysis.md +436 -0
- package/skills_ref/static-analysis/skills/sarif-parsing/SKILL.md +479 -0
- package/skills_ref/static-analysis/skills/sarif-parsing/resources/jq-queries.md +162 -0
- package/skills_ref/static-analysis/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
- package/skills_ref/static-analysis/skills/semgrep/SKILL.md +431 -0
- package/skills_ref/static-analysis/skills/semgrep/references/rulesets.md +162 -0
- package/skills_ref/static-analysis/skills/semgrep/references/scanner-task-prompt.md +102 -0
- package/skills_ref/static-analysis/skills/semgrep/references/triage-task-prompt.md +122 -0
- package/skills_ref/static-analysis/skills/semgrep/scripts/merge_triaged_sarif.py +252 -0
- package/skills_ref/summarize/SKILL.md +87 -0
- package/skills_ref/tdd/SKILL.md +371 -0
- package/skills_ref/tdd/testing-anti-patterns.md +299 -0
- package/skills_ref/telegram-send/SKILL.md +99 -0
- package/skills_ref/terraform/README.md +105 -0
- package/skills_ref/terraform/code-generation/.claude-plugin/plugin.json +30 -0
- package/skills_ref/terraform/code-generation/skills/azure-verified-modules/SKILL.md +613 -0
- package/skills_ref/terraform/code-generation/skills/terraform-style-guide/SKILL.md +353 -0
- package/skills_ref/terraform/code-generation/skills/terraform-test/SKILL.md +1669 -0
- package/skills_ref/terraform/module-generation/.claude-plugin/plugin.json +30 -0
- package/skills_ref/terraform/module-generation/skills/refactor-module/SKILL.md +538 -0
- package/skills_ref/terraform/module-generation/skills/terraform-stacks/SKILL.md +468 -0
- package/skills_ref/terraform/module-generation/skills/terraform-stacks/references/api-monitoring.md +543 -0
- package/skills_ref/terraform/module-generation/skills/terraform-stacks/references/component-blocks.md +476 -0
- package/skills_ref/terraform/module-generation/skills/terraform-stacks/references/deployment-blocks.md +391 -0
- package/skills_ref/terraform/module-generation/skills/terraform-stacks/references/examples.md +1529 -0
- package/skills_ref/terraform/module-generation/skills/terraform-stacks/references/linked-stacks.md +187 -0
- package/skills_ref/terraform/module-generation/skills/terraform-stacks/references/troubleshooting.md +671 -0
- package/skills_ref/terraform/provider-development/.claude-plugin/plugin.json +13 -0
- package/skills_ref/terraform/provider-development/skills/new-terraform-provider/SKILL.md +25 -0
- package/skills_ref/terraform/provider-development/skills/new-terraform-provider/assets/main.go +40 -0
- package/skills_ref/terraform/provider-development/skills/provider-actions/SKILL.md +478 -0
- package/skills_ref/terraform/provider-development/skills/provider-resources/SKILL.md +599 -0
- package/skills_ref/terraform/provider-development/skills/run-acceptance-tests/SKILL.md +41 -0
- package/skills_ref/theme-factory/LICENSE.txt +202 -0
- package/skills_ref/theme-factory/SKILL.md +59 -0
- package/skills_ref/theme-factory/theme-showcase.pdf +0 -0
- package/skills_ref/theme-factory/themes/arctic-frost.md +19 -0
- package/skills_ref/theme-factory/themes/botanical-garden.md +19 -0
- package/skills_ref/theme-factory/themes/desert-rose.md +19 -0
- package/skills_ref/theme-factory/themes/forest-canopy.md +19 -0
- package/skills_ref/theme-factory/themes/golden-hour.md +19 -0
- package/skills_ref/theme-factory/themes/midnight-galaxy.md +19 -0
- package/skills_ref/theme-factory/themes/modern-minimalist.md +19 -0
- package/skills_ref/theme-factory/themes/ocean-depths.md +19 -0
- package/skills_ref/theme-factory/themes/sunset-boulevard.md +19 -0
- package/skills_ref/theme-factory/themes/tech-innovation.md +19 -0
- package/skills_ref/things-mac/SKILL.md +86 -0
- package/skills_ref/tmux/SKILL.md +153 -0
- package/skills_ref/transcribe/SKILL.md +81 -0
- package/skills_ref/trello/SKILL.md +95 -0
- package/skills_ref/tts/SKILL.md +99 -0
- package/skills_ref/vercel-deploy/SKILL.md +115 -0
- package/skills_ref/video-downloader/SKILL.md +99 -0
- package/skills_ref/video-downloader/scripts/download_video.py +145 -0
- package/skills_ref/video-frames/SKILL.md +46 -0
- package/skills_ref/vision-click/SKILL.md +128 -0
- package/skills_ref/weather/SKILL.md +112 -0
- package/skills_ref/web-artifacts-builder/LICENSE.txt +202 -0
- package/skills_ref/web-artifacts-builder/SKILL.md +74 -0
- package/skills_ref/web-artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/skills_ref/web-artifacts-builder/scripts/init-artifact.sh +322 -0
- package/skills_ref/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/skills_ref/web-perf/SKILL.md +193 -0
- package/skills_ref/web-routing/SKILL.md +26 -0
- package/skills_ref/whatsapp/SKILL.md +255 -0
- package/skills_ref/whatsapp/assets/agent-app-integration-example.json +35 -0
- package/skills_ref/whatsapp/assets/databases-example.json +11 -0
- package/skills_ref/whatsapp/assets/function-decide-route-interactive-buttons.json +6 -0
- package/skills_ref/whatsapp/assets/functions-example.json +5 -0
- package/skills_ref/whatsapp/assets/workflow-agent-simple.json +31 -0
- package/skills_ref/whatsapp/assets/workflow-api-template-wait-agent.json +59 -0
- package/skills_ref/whatsapp/assets/workflow-customer-support-intake-agent.json +56 -0
- package/skills_ref/whatsapp/assets/workflow-decision.json +83 -0
- package/skills_ref/whatsapp/assets/workflow-interactive-buttons-decide-ai.json +89 -0
- package/skills_ref/whatsapp/assets/workflow-interactive-buttons-decide-function.json +88 -0
- package/skills_ref/whatsapp/assets/workflow-linear.json +53 -0
- package/skills_ref/whatsapp/package.json +10 -0
- package/skills_ref/whatsapp/references/app-integrations.md +89 -0
- package/skills_ref/whatsapp/references/databases-reference.md +21 -0
- package/skills_ref/whatsapp/references/execution-context.md +42 -0
- package/skills_ref/whatsapp/references/function-contracts.md +55 -0
- package/skills_ref/whatsapp/references/functions-payloads.md +87 -0
- package/skills_ref/whatsapp/references/functions-reference.md +133 -0
- package/skills_ref/whatsapp/references/graph-contract.md +145 -0
- package/skills_ref/whatsapp/references/node-types.md +430 -0
- package/skills_ref/whatsapp/references/triggers.md +20 -0
- package/skills_ref/whatsapp/references/workflow-overview.md +22 -0
- package/skills_ref/whatsapp/references/workflow-reference.md +123 -0
- package/skills_ref/whatsapp/scripts/configure-prop.js +113 -0
- package/skills_ref/whatsapp/scripts/create-connect-token.js +38 -0
- package/skills_ref/whatsapp/scripts/create-function.js +64 -0
- package/skills_ref/whatsapp/scripts/create-integration.js +137 -0
- package/skills_ref/whatsapp/scripts/create-row.js +47 -0
- package/skills_ref/whatsapp/scripts/create-trigger.js +88 -0
- package/skills_ref/whatsapp/scripts/create-workflow.js +85 -0
- package/skills_ref/whatsapp/scripts/delete-integration.js +44 -0
- package/skills_ref/whatsapp/scripts/delete-row.js +49 -0
- package/skills_ref/whatsapp/scripts/delete-trigger.js +44 -0
- package/skills_ref/whatsapp/scripts/deploy-function.js +47 -0
- package/skills_ref/whatsapp/scripts/edit-graph.js +289 -0
- package/skills_ref/whatsapp/scripts/get-action-schema.js +44 -0
- package/skills_ref/whatsapp/scripts/get-context-value.js +80 -0
- package/skills_ref/whatsapp/scripts/get-execution-event.js +55 -0
- package/skills_ref/whatsapp/scripts/get-execution.js +44 -0
- package/skills_ref/whatsapp/scripts/get-function.js +43 -0
- package/skills_ref/whatsapp/scripts/get-graph.js +85 -0
- package/skills_ref/whatsapp/scripts/get-table.js +45 -0
- package/skills_ref/whatsapp/scripts/get-workflow.js +44 -0
- package/skills_ref/whatsapp/scripts/invoke-function.js +60 -0
- package/skills_ref/whatsapp/scripts/lib/databases/args.js +87 -0
- package/skills_ref/whatsapp/scripts/lib/databases/filters.js +30 -0
- package/skills_ref/whatsapp/scripts/lib/databases/kapso-api.js +70 -0
- package/skills_ref/whatsapp/scripts/lib/functions/args.js +55 -0
- package/skills_ref/whatsapp/scripts/lib/functions/kapso-api.js +70 -0
- package/skills_ref/whatsapp/scripts/lib/workflows/args.js +53 -0
- package/skills_ref/whatsapp/scripts/lib/workflows/kapso-api.js +123 -0
- package/skills_ref/whatsapp/scripts/lib/workflows/result.js +16 -0
- package/skills_ref/whatsapp/scripts/list-accounts.js +62 -0
- package/skills_ref/whatsapp/scripts/list-apps.js +42 -0
- package/skills_ref/whatsapp/scripts/list-execution-events.js +61 -0
- package/skills_ref/whatsapp/scripts/list-executions.js +53 -0
- package/skills_ref/whatsapp/scripts/list-function-invocations.js +53 -0
- package/skills_ref/whatsapp/scripts/list-functions.js +41 -0
- package/skills_ref/whatsapp/scripts/list-integrations.js +41 -0
- package/skills_ref/whatsapp/scripts/list-provider-models.js +48 -0
- package/skills_ref/whatsapp/scripts/list-tables.js +41 -0
- package/skills_ref/whatsapp/scripts/list-triggers.js +44 -0
- package/skills_ref/whatsapp/scripts/list-whatsapp-phone-numbers.js +56 -0
- package/skills_ref/whatsapp/scripts/list-workflows.js +44 -0
- package/skills_ref/whatsapp/scripts/openapi-explore.mjs +1273 -0
- package/skills_ref/whatsapp/scripts/query-rows.js +71 -0
- package/skills_ref/whatsapp/scripts/reload-props.js +110 -0
- package/skills_ref/whatsapp/scripts/resume-execution.js +75 -0
- package/skills_ref/whatsapp/scripts/search-actions.js +64 -0
- package/skills_ref/whatsapp/scripts/update-execution-status.js +51 -0
- package/skills_ref/whatsapp/scripts/update-function.js +65 -0
- package/skills_ref/whatsapp/scripts/update-graph.js +154 -0
- package/skills_ref/whatsapp/scripts/update-integration.js +82 -0
- package/skills_ref/whatsapp/scripts/update-row.js +51 -0
- package/skills_ref/whatsapp/scripts/update-trigger.js +60 -0
- package/skills_ref/whatsapp/scripts/update-workflow-settings.js +67 -0
- package/skills_ref/whatsapp/scripts/upsert-row.js +64 -0
- package/skills_ref/whatsapp/scripts/validate-graph.js +293 -0
- package/skills_ref/whatsapp/scripts/variables-delete.js +37 -0
- package/skills_ref/whatsapp/scripts/variables-list.js +55 -0
- package/skills_ref/whatsapp/scripts/variables-set.js +39 -0
- package/skills_ref/writing-plans/SKILL.md +116 -0
- package/skills_ref/xlsx/LICENSE.txt +30 -0
- package/skills_ref/xlsx/SKILL.md +292 -0
- package/skills_ref/xlsx/scripts/office/helpers/__init__.py +0 -0
- package/skills_ref/xlsx/scripts/office/helpers/merge_runs.py +199 -0
- package/skills_ref/xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/skills_ref/xlsx/scripts/office/pack.py +159 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/skills_ref/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/skills_ref/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/skills_ref/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/skills_ref/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/skills_ref/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/skills_ref/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/skills_ref/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/skills_ref/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/skills_ref/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/skills_ref/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/skills_ref/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/skills_ref/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/skills_ref/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/skills_ref/xlsx/scripts/office/soffice.py +183 -0
- package/skills_ref/xlsx/scripts/office/unpack.py +132 -0
- package/skills_ref/xlsx/scripts/office/validate.py +111 -0
- package/skills_ref/xlsx/scripts/office/validators/__init__.py +15 -0
- package/skills_ref/xlsx/scripts/office/validators/base.py +847 -0
- package/skills_ref/xlsx/scripts/office/validators/docx.py +446 -0
- package/skills_ref/xlsx/scripts/office/validators/pptx.py +275 -0
- package/skills_ref/xlsx/scripts/office/validators/redlining.py +247 -0
- package/skills_ref/xlsx/scripts/recalc.py +184 -0
- package/skills_ref/xurl/SKILL.md +461 -0
|
@@ -0,0 +1,1144 @@
|
|
|
1
|
+
# Next.js (TypeScript/JavaScript) Web Security Spec (Next.js 16.1.x, Node.js 20.9+)
|
|
2
|
+
|
|
3
|
+
This document is designed as a **security spec** that supports:
|
|
4
|
+
|
|
5
|
+
1. **Secure-by-default code generation** for new Next.js backend code (Route Handlers, API Routes, Server Actions, Proxy/Middleware).
|
|
6
|
+
2. **Security review / vulnerability hunting** in existing Next.js repos (passive “notice issues while working” and active “scan the repo and report findings”).
|
|
7
|
+
|
|
8
|
+
It is intentionally written as a set of **normative requirements** (“MUST/SHOULD/MAY”) plus **audit rules** (what bad patterns look like, how to detect them, and how to fix/mitigate them).
|
|
9
|
+
|
|
10
|
+
Target scope: Next.js **16.1.x** (latest line shown in the App Router docs) ([Next.js][1]), running on Node.js **20.9+** (per Next.js system requirements). ([Next.js][2])
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 0) Safety, boundaries, and anti-abuse constraints (MUST FOLLOW)
|
|
15
|
+
|
|
16
|
+
* MUST NOT request, output, log, or commit secrets (API keys, passwords, private keys, session cookies, OAuth tokens, `process.env` dumps, database URLs with credentials).
|
|
17
|
+
* MUST NOT “fix” security by disabling protections (e.g., disabling origin checks, relaxing CORS to `*`, skipping authz checks, turning off cookie security flags, turning off CSP because it’s “hard”).
|
|
18
|
+
* MUST provide **evidence-based findings** during audits: cite file paths, code snippets, and configuration values that justify each claim.
|
|
19
|
+
* MUST treat uncertainty honestly: if a protection might exist in infrastructure (reverse proxy, CDN, WAF, platform headers), report it as “not visible in app code; verify at runtime/config”.
|
|
20
|
+
* MUST assume all request-facing server code is reachable by attackers unless there is a clearly enforced auth boundary (not just “the UI doesn’t link to it”).
|
|
21
|
+
* MUST treat TypeScript types as **non-security boundaries**: types do not validate runtime input; runtime checks are required. ([Next.js][3])
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 1) Operating modes
|
|
26
|
+
|
|
27
|
+
### 1.1 Generation mode (default)
|
|
28
|
+
|
|
29
|
+
When asked to write new Next.js code or modify existing code:
|
|
30
|
+
|
|
31
|
+
* MUST follow every **MUST** requirement in this spec.
|
|
32
|
+
* SHOULD follow every **SHOULD** requirement unless the user explicitly says otherwise.
|
|
33
|
+
* MUST prefer safe-by-default APIs and proven libraries over custom security code.
|
|
34
|
+
* MUST avoid introducing new risky sinks (dynamic code execution, unsafe redirects, serving user files as HTML, SSRF URL fetchers, building SQL strings, etc.).
|
|
35
|
+
|
|
36
|
+
### 1.2 Passive review mode (always on while editing)
|
|
37
|
+
|
|
38
|
+
While working anywhere in a Next.js repo (even if the user did not ask for a security scan):
|
|
39
|
+
|
|
40
|
+
* MUST “notice” violations of this spec in touched/nearby code.
|
|
41
|
+
* SHOULD mention issues as they come up, with a brief explanation + safe fix.
|
|
42
|
+
|
|
43
|
+
### 1.3 Active audit mode (explicit scan request)
|
|
44
|
+
|
|
45
|
+
When the user asks to “scan”, “audit”, or “hunt for vulns”:
|
|
46
|
+
|
|
47
|
+
* MUST systematically search the codebase for violations of this spec.
|
|
48
|
+
* MUST output findings in a structured format (see §2.3).
|
|
49
|
+
|
|
50
|
+
Recommended audit order:
|
|
51
|
+
|
|
52
|
+
1. Deployment entrypoints and environment (Dockerfiles, `package.json` scripts, hosting config).
|
|
53
|
+
2. Next.js config (`next.config.*`), Proxy/Middleware, routing patterns.
|
|
54
|
+
3. Authentication, sessions, cookies.
|
|
55
|
+
4. CSRF protections and state-changing endpoints (Server Actions, Route Handlers, API Routes).
|
|
56
|
+
5. XSS (React + CSP) and unsafe HTML rendering.
|
|
57
|
+
6. Cache/data-leak hazards (static rendering + caching + “use cache”).
|
|
58
|
+
7. File handling (uploads/downloads) and path traversal.
|
|
59
|
+
8. Injection classes (SQL/ORM misuse, command execution, unsafe deserialization).
|
|
60
|
+
9. Outbound requests (SSRF).
|
|
61
|
+
10. Redirect handling (open redirects).
|
|
62
|
+
11. CORS and security headers.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 2) Definitions and review guidance
|
|
67
|
+
|
|
68
|
+
### 2.1 Untrusted input (treat as attacker-controlled unless proven otherwise)
|
|
69
|
+
|
|
70
|
+
In Next.js backends, untrusted input includes:
|
|
71
|
+
|
|
72
|
+
App Router:
|
|
73
|
+
|
|
74
|
+
* Route Handler params and request data:
|
|
75
|
+
|
|
76
|
+
* `context.params` (dynamic segments), search params (`request.url`, `new URL(request.url).searchParams`)
|
|
77
|
+
* `request.headers`, `request.cookies`
|
|
78
|
+
* `await request.json()`, `await request.formData()`, `await request.text()`
|
|
79
|
+
* Dynamic APIs used in Server Components/Server Functions:
|
|
80
|
+
|
|
81
|
+
* `headers()` and `cookies()` values ([Next.js][4])
|
|
82
|
+
|
|
83
|
+
Pages Router:
|
|
84
|
+
|
|
85
|
+
* `req.query`, `req.cookies`, `req.body` in `pages/api/*` handlers ([Next.js][3])
|
|
86
|
+
|
|
87
|
+
Plus:
|
|
88
|
+
|
|
89
|
+
* Anything from external systems (webhooks, third-party APIs, message queues)
|
|
90
|
+
* Any persisted user content (DB rows) that originated from users
|
|
91
|
+
|
|
92
|
+
### 2.2 State-changing request
|
|
93
|
+
|
|
94
|
+
A request is state-changing if it can create/update/delete data, change auth/session state, trigger side effects (purchase, email send, webhook send), or initiate privileged actions.
|
|
95
|
+
|
|
96
|
+
Special note for Next.js:
|
|
97
|
+
|
|
98
|
+
* **Server Actions** are invoked via network requests and can mutate state; treat them as state-changing endpoints. ([Next.js][5])
|
|
99
|
+
|
|
100
|
+
### 2.3 Required audit finding format
|
|
101
|
+
|
|
102
|
+
For each issue found, output:
|
|
103
|
+
|
|
104
|
+
* Rule ID:
|
|
105
|
+
* Severity: Critical / High / Medium / Low
|
|
106
|
+
* Location: file path + function/route name + line(s)
|
|
107
|
+
* Evidence: the exact code/config snippet
|
|
108
|
+
* Impact: what could go wrong, who can exploit it
|
|
109
|
+
* Fix: safe change (prefer minimal diff)
|
|
110
|
+
* Mitigation: defense-in-depth if immediate fix is hard
|
|
111
|
+
* False positive notes: what to verify if uncertain
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 3) Secure baseline: minimum production configuration (MUST in production)
|
|
116
|
+
|
|
117
|
+
This is the smallest “production baseline” that prevents common Next.js backend misconfigurations.
|
|
118
|
+
|
|
119
|
+
### 3.1 Run Next.js in production mode (MUST)
|
|
120
|
+
|
|
121
|
+
* MUST run `next build` + `next start` (or the managed platform equivalent), not `next dev`. Dev mode has different error/reporting behavior and is not designed for production exposure. ([Next.js][6])
|
|
122
|
+
* MUST ensure `NODE_ENV=production` in production (Next.js defaults `NODE_ENV` based on command; verify the runtime environment). ([Next.js][7])
|
|
123
|
+
|
|
124
|
+
### 3.2 Put a reverse proxy / edge layer in front when self-hosting (MUST for public internet)
|
|
125
|
+
|
|
126
|
+
* If self-hosting, MUST place a reverse proxy (e.g., nginx) or equivalent edge layer in front of the Next.js server to handle malformed requests, slow attacks, payload size limits, rate limiting, and similar concerns. ([Next.js][8])
|
|
127
|
+
|
|
128
|
+
### 3.3 Baseline header/cookie posture (SHOULD)
|
|
129
|
+
|
|
130
|
+
* SHOULD set a baseline of security headers globally (CSP, `X-Content-Type-Options`, clickjacking defense via CSP `frame-ancestors` and/or `X-Frame-Options`, etc.). Next.js provides guidance for implementing CSP via Proxy/headers. ([Next.js][7])
|
|
131
|
+
* MUST ensure auth/session cookies use secure attributes (`Secure`, `HttpOnly`, `SameSite`) as appropriate. ([Next.js][9])
|
|
132
|
+
IMPORTANT NOTE: Only set `Secure` in production environment. When running in a local dev environment over HTTP, do not set `Secure` property on cookies. You should do this conditionally based on if the app is running in production mode. You should also include a property like `SESSION_COOKIE_SECURE` which can be used to disable `Secure` cookies when testing over HTTP.
|
|
133
|
+
|
|
134
|
+
### 3.4 Clear separation between server-only and client code (MUST)
|
|
135
|
+
|
|
136
|
+
* MUST prevent secrets and privileged logic from being bundled into client code.
|
|
137
|
+
* MUST treat `NEXT_PUBLIC_*` environment variables as public (browser-exposed and inlined at build time). ([Next.js][7])
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 4) Rules (generation + audit)
|
|
142
|
+
|
|
143
|
+
Each rule contains: required practice, insecure patterns, detection hints, and remediation.
|
|
144
|
+
|
|
145
|
+
### NEXT-DEPLOY-001: Do not run `next dev` in production; ensure production mode behavior
|
|
146
|
+
|
|
147
|
+
Severity: High (if production)
|
|
148
|
+
|
|
149
|
+
NOTE: If they are deploying to a specific Next.js hosting provider, they do not need to worry about this.
|
|
150
|
+
|
|
151
|
+
Required:
|
|
152
|
+
|
|
153
|
+
* MUST NOT deploy `next dev` or any development server mode to production.
|
|
154
|
+
* MUST ensure production builds and production runtime are used for any public deployment. ([Next.js][6])
|
|
155
|
+
|
|
156
|
+
Insecure patterns:
|
|
157
|
+
|
|
158
|
+
* `next dev` in Docker `CMD`, Procfile, platform start command.
|
|
159
|
+
* `NODE_ENV=development` in production environment config.
|
|
160
|
+
* Debug/dev-only endpoints or flags exposed publicly.
|
|
161
|
+
|
|
162
|
+
Detection hints:
|
|
163
|
+
|
|
164
|
+
* Search `package.json` scripts and deployment manifests for `next dev`.
|
|
165
|
+
* Search infra for `NODE_ENV=development` or missing `NODE_ENV`.
|
|
166
|
+
* Check Kubernetes/PM2/systemd entrypoints for `next dev`.
|
|
167
|
+
|
|
168
|
+
Fix:
|
|
169
|
+
|
|
170
|
+
* Use `next build` during CI/build and `next start` at runtime (or platform-native build/run).
|
|
171
|
+
* Ensure environment sets `NODE_ENV=production`.
|
|
172
|
+
|
|
173
|
+
Note:
|
|
174
|
+
|
|
175
|
+
* Dev mode is fine for local development. Only flag if it is being used as a production entrypoint.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
### NEXT-SUPPLY-001: Stay on supported Next.js releases; patch quickly for security advisories
|
|
180
|
+
|
|
181
|
+
Severity: High (Critical if known-vulnerable version)
|
|
182
|
+
|
|
183
|
+
Required:
|
|
184
|
+
|
|
185
|
+
* MUST run a supported Next.js version line and apply security updates promptly. Next.js documents an LTS/support policy. ([Next.js][10])
|
|
186
|
+
* MUST treat published advisories as urgent upgrade signals (e.g., update to a patched release). ([GitHub][11])
|
|
187
|
+
|
|
188
|
+
Insecure patterns:
|
|
189
|
+
|
|
190
|
+
* Running EOL Next.js major/minor without backported security fixes.
|
|
191
|
+
* Ignoring advisories, or pinning `next` to a vulnerable range.
|
|
192
|
+
|
|
193
|
+
Detection hints:
|
|
194
|
+
|
|
195
|
+
* Check `package.json` and lockfiles for `next` version.
|
|
196
|
+
* Compare against Next.js support policy and advisories.
|
|
197
|
+
|
|
198
|
+
IMPORTANT: Any versions older than these minor versions are vulnerable to "react2shell" vulnerability (https://nextjs.org/blog/CVE-2025-66478):
|
|
199
|
+
15.0.5
|
|
200
|
+
15.1.9
|
|
201
|
+
15.2.6
|
|
202
|
+
15.3.6
|
|
203
|
+
15.4.8
|
|
204
|
+
15.5.7
|
|
205
|
+
16.0.7
|
|
206
|
+
|
|
207
|
+
Fix:
|
|
208
|
+
|
|
209
|
+
* Upgrade `next` to a supported and patched version.
|
|
210
|
+
* Add a dependency update process + CI checks.
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
### NEXT-SECRETS-001: Secrets MUST NOT be committed or exposed to the browser
|
|
216
|
+
|
|
217
|
+
Severity: High (Critical if secret is client-exposed)
|
|
218
|
+
|
|
219
|
+
Required:
|
|
220
|
+
|
|
221
|
+
* MUST store secrets in environment variables or a secret manager; MUST NOT commit `.env*` files.
|
|
222
|
+
* MUST treat `.env*` as sensitive; Next.js warns you “almost never want to commit these files.” ([Next.js][7])
|
|
223
|
+
* MUST treat any `NEXT_PUBLIC_*` environment variable as public and browser-visible (inlined into the client bundle at build time). ([Next.js][7])
|
|
224
|
+
|
|
225
|
+
Insecure patterns:
|
|
226
|
+
|
|
227
|
+
* `.env`, `.env.local`, `.env.production` committed to git.
|
|
228
|
+
* `NEXT_PUBLIC_API_KEY`, `NEXT_PUBLIC_SECRET`, `NEXT_PUBLIC_DATABASE_URL`, etc.
|
|
229
|
+
* Rendering `process.env` values into HTML or returning them from API routes.
|
|
230
|
+
|
|
231
|
+
Detection hints:
|
|
232
|
+
|
|
233
|
+
* Scan git history and repo files for `.env` content, `DB_PASS=`, `API_KEY=`, `SECRET=`.
|
|
234
|
+
* Grep for `NEXT_PUBLIC_` and review any sensitive-looking names.
|
|
235
|
+
* Search for `process.env` usage in Client Components (`"use client"`) and shared modules.
|
|
236
|
+
|
|
237
|
+
Fix:
|
|
238
|
+
|
|
239
|
+
* Move secrets to server-only env vars (no `NEXT_PUBLIC_` prefix).
|
|
240
|
+
* Ensure `.env*` is ignored and secrets are injected at deploy time.
|
|
241
|
+
* Rotate leaked keys.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
### NEXT-SECRETS-002: Avoid server-only → client bundling mistakes (server/client boundary is a security boundary)
|
|
246
|
+
|
|
247
|
+
Severity: High
|
|
248
|
+
|
|
249
|
+
Required:
|
|
250
|
+
|
|
251
|
+
* MUST ensure server-only modules (DB clients, secret-dependent code) are not imported into Client Components or other client-bundled code paths.
|
|
252
|
+
* SHOULD use server-only patterns/layers (e.g., a dedicated DAL and server-only modules) and treat boundary violations as security bugs. Next.js explicitly discusses the “server-only” concept for sensitive modules. ([Next.js][6])
|
|
253
|
+
|
|
254
|
+
Insecure patterns:
|
|
255
|
+
|
|
256
|
+
* Importing DB clients, admin SDKs, or secret-reading modules into `"use client"` components.
|
|
257
|
+
* Shared `lib/` modules imported by both server and client code that reference secrets.
|
|
258
|
+
|
|
259
|
+
Detection hints:
|
|
260
|
+
|
|
261
|
+
* Search for `"use client"` and examine its imports for server-only dependencies.
|
|
262
|
+
* Look for DB client packages (`pg`, `mysql2`, `mongoose`, `prisma`, admin SDKs) imported from `components/` or other client paths.
|
|
263
|
+
* Search for `process.env` access in UI components.
|
|
264
|
+
|
|
265
|
+
Fix:
|
|
266
|
+
|
|
267
|
+
* Refactor into `lib/server/*` and only import from server contexts (Route Handlers, Server Components, Server Actions).
|
|
268
|
+
* Add an explicit “server-only” guard pattern (and/or tests) to prevent accidental imports.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
### NEXT-AUTH-001: Authentication/authorization MUST be enforced server-side for every protected action
|
|
273
|
+
|
|
274
|
+
Severity: High
|
|
275
|
+
|
|
276
|
+
Required:
|
|
277
|
+
|
|
278
|
+
* MUST enforce authn/authz in server-side code for:
|
|
279
|
+
|
|
280
|
+
* Route Handlers (`app/**/route.ts`) ([Next.js][1])
|
|
281
|
+
* API Routes (`pages/api/**`) ([Next.js][3])
|
|
282
|
+
* Server Actions (`"use server"` functions invoked by clients) ([Next.js][6])
|
|
283
|
+
* MUST NOT rely on client-side checks (hiding UI, route guards on the client) as the only protection.
|
|
284
|
+
|
|
285
|
+
Insecure patterns:
|
|
286
|
+
|
|
287
|
+
* Sensitive Route Handlers with no session verification.
|
|
288
|
+
* Server Actions that mutate data but do not validate user identity/permissions.
|
|
289
|
+
* “Authorization” checks in React components only.
|
|
290
|
+
|
|
291
|
+
Detection hints:
|
|
292
|
+
|
|
293
|
+
* Enumerate all Route Handlers and API Routes; for each, identify whether it requires auth.
|
|
294
|
+
* Grep for `"use server"` and review all exported actions for auth checks.
|
|
295
|
+
* Search for admin actions triggered by query params / form submits.
|
|
296
|
+
|
|
297
|
+
Fix:
|
|
298
|
+
|
|
299
|
+
* Centralize auth helpers and call them in every protected endpoint/action.
|
|
300
|
+
* Implement least-privilege authorization checks (role/resource ownership) per action.
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
### NEXT-AUTH-002: Proxy/Middleware-based auth MUST NOT create route coverage gaps
|
|
305
|
+
|
|
306
|
+
Severity: High
|
|
307
|
+
|
|
308
|
+
Required:
|
|
309
|
+
|
|
310
|
+
* If using **Proxy** or **Middleware** for authentication checks, MUST ensure it covers every route that needs protection.
|
|
311
|
+
* Next.js documentation notes Proxy can use a `matcher`, and for auth it’s recommended Proxy runs on all routes. ([Next.js][12])
|
|
312
|
+
* MUST treat `matcher` mistakes as an auth bypass risk.
|
|
313
|
+
|
|
314
|
+
Insecure patterns:
|
|
315
|
+
|
|
316
|
+
* Proxy/Middleware only matches “pages” but not `/api/*`, or only matches some route groups.
|
|
317
|
+
* “Denylist” style matchers that miss alternative request forms (framework-internal variants, RSC navigations, etc.).
|
|
318
|
+
|
|
319
|
+
Detection hints:
|
|
320
|
+
|
|
321
|
+
* Inspect `proxy.ts` / `middleware.ts` and its `matcher`.
|
|
322
|
+
* Compare matchers to the full set of routes (including `app/api/**` and `pages/api/**`).
|
|
323
|
+
* Ensure static assets and Next internals are excluded only intentionally, and that sensitive routes are included.
|
|
324
|
+
|
|
325
|
+
Fix:
|
|
326
|
+
|
|
327
|
+
* Prefer allowlisting protected route prefixes or running Proxy globally and doing internal allow/deny logic.
|
|
328
|
+
* Add integration tests: request protected route without auth and assert denial.
|
|
329
|
+
|
|
330
|
+
Notes:
|
|
331
|
+
|
|
332
|
+
* Proxy is commonly used for “optimistic checks”; it is not a complete authorization system by itself. ([Next.js][12])
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
### NEXT-CSRF-001: Cookie-authenticated state-changing endpoints MUST be CSRF-protected
|
|
337
|
+
|
|
338
|
+
Severity: High
|
|
339
|
+
|
|
340
|
+
- IMPORTANT NOTE: If cookies are not being used for auth (ie auth is via Authentication header or other passed token), then there is no CSRF risk.
|
|
341
|
+
|
|
342
|
+
Required:
|
|
343
|
+
|
|
344
|
+
* MUST protect every state-changing endpoint that relies on cookies for auth (POST/PUT/PATCH/DELETE).
|
|
345
|
+
* For **Server Actions**, Next.js performs an Origin/Host comparison to help prevent CSRF; do not disable or weaken it. ([Next.js][5])
|
|
346
|
+
* If Server Actions must be callable from additional trusted origins (e.g., a trusted proxy domain), MUST use `allowedOrigins` with a strict allowlist. ([Next.js][5])
|
|
347
|
+
* For **Route Handlers** and **API Routes**, MUST implement CSRF protections explicitly (tokens and/or strict Origin/Referer + SameSite + custom headers). Route Handlers are an “escape hatch” and require application-level security decisions. ([Next.js][6])
|
|
348
|
+
|
|
349
|
+
Insecure patterns:
|
|
350
|
+
|
|
351
|
+
* POST endpoints (including Server Actions) that mutate state and accept cross-site requests with no token/origin checks.
|
|
352
|
+
* `allowedOrigins: ['*']` (or broad wildcards) or “reflect Origin” logic.
|
|
353
|
+
* Using GET requests to change state.
|
|
354
|
+
|
|
355
|
+
Detection hints:
|
|
356
|
+
|
|
357
|
+
* Enumerate all state-changing endpoints and determine auth mechanism.
|
|
358
|
+
* Search for `allowedOrigins` and confirm the list is small, specific, and justified. ([Next.js][5])
|
|
359
|
+
* In Route Handlers/API Routes: look for missing CSRF token validation or missing Origin/Referer checks.
|
|
360
|
+
|
|
361
|
+
Fix:
|
|
362
|
+
|
|
363
|
+
* Implement a CSRF token strategy for cookie-auth endpoints.
|
|
364
|
+
* Keep cookies `SameSite=Lax` or `Strict` when compatible; don’t treat SameSite alone as sufficient.
|
|
365
|
+
* Use strict Origin validation for JSON API endpoints, especially when not using CSRF tokens.
|
|
366
|
+
|
|
367
|
+
Notes:
|
|
368
|
+
|
|
369
|
+
* XSS can defeat CSRF protections; CSRF defenses do not replace XSS prevention.
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
### NEXT-SESS-001: Session cookies MUST use secure attributes in production
|
|
374
|
+
|
|
375
|
+
Severity: Medium
|
|
376
|
+
|
|
377
|
+
Required (production, HTTPS):
|
|
378
|
+
|
|
379
|
+
* MUST set session/auth cookies with:
|
|
380
|
+
|
|
381
|
+
* `Secure: true` (HTTPS-only) IMPORTANT NOTE: Only set `Secure` in production environment. When running in a local dev environment over HTTP, do not set `Secure` property on cookies. You should do this conditionally based on if the app is running in production mode. You should also include a property like `SESSION_COOKIE_SECURE` which can be used to disable `Secure` cookies when testing over HTTP.
|
|
382
|
+
* `HttpOnly: true` (not readable by JS)
|
|
383
|
+
* `SameSite: 'Lax'` (recommended) or `'Strict'` if compatible
|
|
384
|
+
* Only use `SameSite: 'none'` when you truly need cross-site cookies, and then MUST also set `Secure`. Cookie options are supported in Next.js cookie APIs. ([Next.js][9])
|
|
385
|
+
|
|
386
|
+
Insecure patterns:
|
|
387
|
+
|
|
388
|
+
* `secure: false` in production.
|
|
389
|
+
* `httpOnly: false` for auth cookies.
|
|
390
|
+
* `sameSite: 'none'` without a clear need, especially on cookie-authenticated state-changing endpoints.
|
|
391
|
+
|
|
392
|
+
Detection hints:
|
|
393
|
+
|
|
394
|
+
* Search for cookie setting sites (`cookies().set(...)`, `Set-Cookie` headers, auth library cookie config).
|
|
395
|
+
* Review cookie options used in Route Handlers and Server Actions. ([Next.js][9])
|
|
396
|
+
|
|
397
|
+
Fix:
|
|
398
|
+
|
|
399
|
+
* Set secure cookie attributes at the auth/session layer.
|
|
400
|
+
* Reduce cookie scope: avoid wide `domain` unless you explicitly need subdomain-wide cookies.
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
### NEXT-SESS-002: Sessions MUST be bounded and resistant to fixation/replay
|
|
405
|
+
|
|
406
|
+
Severity: Low
|
|
407
|
+
|
|
408
|
+
Required:
|
|
409
|
+
|
|
410
|
+
* SHOULD set bounded session lifetimes appropriate to the app.
|
|
411
|
+
* SHOULD rotate session identifiers on login and privilege changes.
|
|
412
|
+
* MUST NOT store sensitive secrets directly in client-readable storage (including cookies that are not encrypted).
|
|
413
|
+
|
|
414
|
+
Insecure patterns:
|
|
415
|
+
|
|
416
|
+
* Long-lived admin sessions with no rotation.
|
|
417
|
+
* “Remember me forever” for privileged roles without additional risk controls.
|
|
418
|
+
* Storing access tokens/refresh tokens in non-HttpOnly cookies or localStorage.
|
|
419
|
+
|
|
420
|
+
Detection hints:
|
|
421
|
+
|
|
422
|
+
* Review auth library configuration for expiration and rotation.
|
|
423
|
+
* Search for `localStorage.setItem('token'...)` and non-HttpOnly cookie usage.
|
|
424
|
+
|
|
425
|
+
Fix:
|
|
426
|
+
|
|
427
|
+
* Use short lifetimes for privileged sessions; refresh with rotation.
|
|
428
|
+
* Store only opaque session IDs in cookies; keep sensitive material server-side.
|
|
429
|
+
|
|
430
|
+
---
|
|
431
|
+
|
|
432
|
+
### NEXT-INPUT-001: Runtime input validation is mandatory (TypeScript is not validation)
|
|
433
|
+
|
|
434
|
+
Severity: High
|
|
435
|
+
|
|
436
|
+
Required:
|
|
437
|
+
|
|
438
|
+
* MUST validate and normalize all attacker-controlled input at runtime (schemas, type checks, bounds).
|
|
439
|
+
* Next.js API Routes explicitly note `req.body` is `any` and must be validated before use. ([Next.js][3])
|
|
440
|
+
* MUST validate Server Action arguments (treat as hostile). ([Next.js][6])
|
|
441
|
+
|
|
442
|
+
Insecure patterns:
|
|
443
|
+
|
|
444
|
+
* Trusting `req.body` shape directly.
|
|
445
|
+
* Passing `params.id`/`searchParams` directly into DB queries or file paths.
|
|
446
|
+
* Parsing JSON and then assuming types without validation.
|
|
447
|
+
|
|
448
|
+
Detection hints:
|
|
449
|
+
|
|
450
|
+
* Identify endpoints that accept JSON/form input and check for schema validation.
|
|
451
|
+
* Grep for `req.body.` usage and for `await request.json()` usage in Route Handlers; verify validation exists.
|
|
452
|
+
|
|
453
|
+
Fix:
|
|
454
|
+
|
|
455
|
+
* Add schema validation (e.g., zod/yup/valibot) and reject invalid input with 4xx.
|
|
456
|
+
* Validate IDs as strict types (UUID/int) and enforce length/charset constraints.
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
460
|
+
### NEXT-HEADERS-001: Essential security headers MUST be set (in app or at the edge)
|
|
461
|
+
|
|
462
|
+
Severity: Low
|
|
463
|
+
|
|
464
|
+
Required (typical web app):
|
|
465
|
+
|
|
466
|
+
* SHOULD set:
|
|
467
|
+
|
|
468
|
+
* CSP (`Content-Security-Policy`) (see NEXT-CSP-001)
|
|
469
|
+
* `X-Content-Type-Options: nosniff`
|
|
470
|
+
* Clickjacking defense (`frame-ancestors` in CSP and/or `X-Frame-Options`)
|
|
471
|
+
* `Referrer-Policy` and `Permissions-Policy` when appropriate
|
|
472
|
+
* MUST ensure cookies are set with secure attributes (see NEXT-SESS-001). ([Next.js][9])
|
|
473
|
+
|
|
474
|
+
Insecure patterns:
|
|
475
|
+
|
|
476
|
+
* No security headers anywhere (app or edge).
|
|
477
|
+
* Allowing iframing unintentionally.
|
|
478
|
+
* `Content-Type` sniffing possible due to missing `nosniff`.
|
|
479
|
+
|
|
480
|
+
Detection hints:
|
|
481
|
+
|
|
482
|
+
* Check `proxy.ts` / middleware for `response.headers.set(...)`. ([Next.js][7])
|
|
483
|
+
* If not visible in app code, flag as “verify at edge/CDN”.
|
|
484
|
+
|
|
485
|
+
Fix:
|
|
486
|
+
|
|
487
|
+
* Set headers centrally (Proxy/Middleware or other centralized mechanism).
|
|
488
|
+
* Ensure consistent headers across routes.
|
|
489
|
+
|
|
490
|
+
---
|
|
491
|
+
|
|
492
|
+
### NEXT-CSP-001: Use a CSP to reduce XSS impact; prefer nonces for scripts
|
|
493
|
+
|
|
494
|
+
Severity: Medium
|
|
495
|
+
|
|
496
|
+
NOTE: It is most important to set the CSP's script-src. All other directives are not as important and can generally be excluded for the ease of development.
|
|
497
|
+
|
|
498
|
+
Required:
|
|
499
|
+
|
|
500
|
+
* SHOULD deploy a CSP, ideally with nonces for scripts.
|
|
501
|
+
* SHOULD follow Next.js guidance for CSP implementation (including nonce generation and header application). ([Next.js][7])
|
|
502
|
+
* MUST avoid loosening CSP as a “fix” (e.g., `script-src 'unsafe-inline'`) without explicit risk acceptance.
|
|
503
|
+
|
|
504
|
+
Insecure patterns:
|
|
505
|
+
|
|
506
|
+
* CSP missing on apps that display user-generated HTML/markdown.
|
|
507
|
+
* CSP that broadly enables inline scripts or eval without strict justification.
|
|
508
|
+
|
|
509
|
+
Detection hints:
|
|
510
|
+
|
|
511
|
+
* Search for `Content-Security-Policy` header setting and examine its directives.
|
|
512
|
+
* Check use of `next/script` and whether a nonce is provided when CSP requires it.
|
|
513
|
+
|
|
514
|
+
Fix:
|
|
515
|
+
|
|
516
|
+
* Implement CSP per Next.js guidance; use a nonce and apply it consistently.
|
|
517
|
+
* Reduce inline scripts; avoid `eval`.
|
|
518
|
+
|
|
519
|
+
Notes:
|
|
520
|
+
|
|
521
|
+
* CSP is defense-in-depth; it does not replace proper output encoding and sanitization.
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
### NEXT-XSS-001: Prevent reflected/stored XSS in React/Next rendering
|
|
526
|
+
|
|
527
|
+
Severity: High
|
|
528
|
+
|
|
529
|
+
Required:
|
|
530
|
+
|
|
531
|
+
* MUST rely on React’s default escaping; MUST NOT insert untrusted HTML into the DOM without sanitization.
|
|
532
|
+
* MUST treat these as high-risk sinks:
|
|
533
|
+
|
|
534
|
+
* `dangerouslySetInnerHTML`
|
|
535
|
+
* rendering user-controlled strings into `<script>` tags or event handler attributes
|
|
536
|
+
* MUST avoid serving uploaded HTML as active HTML (serve as attachment or sanitize/transform).
|
|
537
|
+
|
|
538
|
+
Insecure patterns:
|
|
539
|
+
|
|
540
|
+
* `<div dangerouslySetInnerHTML={{ __html: userContent }} />` with no sanitizer.
|
|
541
|
+
* Markdown renderers configured to allow raw HTML with no sanitizer.
|
|
542
|
+
* Returning user content with `Content-Type: text/html` from a Route Handler.
|
|
543
|
+
|
|
544
|
+
Detection hints:
|
|
545
|
+
|
|
546
|
+
* Search for `dangerouslySetInnerHTML`, `__html:`.
|
|
547
|
+
* Search for template-like string concatenation that builds HTML.
|
|
548
|
+
* Review any “render HTML” or “preview” features.
|
|
549
|
+
|
|
550
|
+
Fix:
|
|
551
|
+
|
|
552
|
+
* Sanitize untrusted HTML with a well-maintained sanitizer; prefer strict allowlists.
|
|
553
|
+
* Prefer rendering user content as text, not HTML.
|
|
554
|
+
* Add CSP to reduce impact.
|
|
555
|
+
|
|
556
|
+
---
|
|
557
|
+
|
|
558
|
+
### NEXT-ACTION-001: Server Actions MUST be treated like public endpoints
|
|
559
|
+
|
|
560
|
+
Severity: High (Critical for privileged actions)
|
|
561
|
+
|
|
562
|
+
Required:
|
|
563
|
+
|
|
564
|
+
* MUST apply the same controls as for Route Handlers:
|
|
565
|
+
|
|
566
|
+
* authn/authz
|
|
567
|
+
* input validation
|
|
568
|
+
* CSRF/origin protections
|
|
569
|
+
* rate limiting for sensitive actions
|
|
570
|
+
* MUST NOT assume Server Actions are “not reachable” or “internal”.
|
|
571
|
+
* MUST understand Server Action request protections:
|
|
572
|
+
|
|
573
|
+
* Next.js compares Origin with host to mitigate CSRF; extra origins must be explicitly allowlisted via `allowedOrigins`. ([Next.js][5])
|
|
574
|
+
|
|
575
|
+
Insecure patterns:
|
|
576
|
+
|
|
577
|
+
* `"use server"` functions that update DB state with no auth check.
|
|
578
|
+
* Adding overly broad `allowedOrigins` to “make it work”.
|
|
579
|
+
|
|
580
|
+
Detection hints:
|
|
581
|
+
|
|
582
|
+
* Grep for `"use server"` and inventory all exported actions.
|
|
583
|
+
* Identify any action doing privileged writes; confirm it checks identity and permission.
|
|
584
|
+
|
|
585
|
+
Fix:
|
|
586
|
+
|
|
587
|
+
* Wrap actions with an authz helper (fail closed).
|
|
588
|
+
* Keep `allowedOrigins` minimal and audited.
|
|
589
|
+
|
|
590
|
+
---
|
|
591
|
+
|
|
592
|
+
### NEXT-ACTION-002: Do not accidentally leak secrets through Server Action closure/binding patterns
|
|
593
|
+
|
|
594
|
+
Severity: Medium (High if important secrets are exposed)
|
|
595
|
+
|
|
596
|
+
Required:
|
|
597
|
+
|
|
598
|
+
* MUST treat Server Action closed-over values as sensitive and design intentionally.
|
|
599
|
+
* Next.js notes that closed-over values are encrypted/signed, but values passed through `.bind` are not encrypted; do not rely on `.bind` to protect secrets. ([Next.js][6])
|
|
600
|
+
* If using a stable encryption key for Server Actions across deployments, MUST treat it as a secret and store securely (do not commit/log it). ([Next.js][6])
|
|
601
|
+
|
|
602
|
+
Insecure patterns:
|
|
603
|
+
|
|
604
|
+
* `myAction.bind(null, process.env.SECRET)` or binding sensitive tokens/IDs that should not be client-influenced.
|
|
605
|
+
* Logging action arguments that include secrets.
|
|
606
|
+
|
|
607
|
+
Detection hints:
|
|
608
|
+
|
|
609
|
+
* Search for `.bind(` on Server Action functions.
|
|
610
|
+
* Search for `process.env` usage near Server Actions.
|
|
611
|
+
|
|
612
|
+
Fix:
|
|
613
|
+
|
|
614
|
+
* Avoid binding secrets into actions; fetch secrets server-side inside the action.
|
|
615
|
+
* Keep action arguments minimal and validated.
|
|
616
|
+
|
|
617
|
+
---
|
|
618
|
+
|
|
619
|
+
### NEXT-CACHE-001: Prevent data leaks via static rendering and shared caching
|
|
620
|
+
|
|
621
|
+
Severity: High (Critical if cross-user data leak)
|
|
622
|
+
|
|
623
|
+
Required:
|
|
624
|
+
|
|
625
|
+
* MUST ensure pages/endpoints that return user-specific or sensitive data are not statically generated or cached in a shared way.
|
|
626
|
+
* Route Handlers are not cached by default, but GET handlers can opt into caching/static behavior; do not do this for per-user data. ([Next.js][1])
|
|
627
|
+
* MUST treat `use cache` and similar caching mechanisms as potentially cross-user unless explicitly proven private; do not cache per-user DB results in shared caches. ([Next.js][1])
|
|
628
|
+
* SHOULD set explicit `Cache-Control: no-store` / `private` for sensitive responses (auth/session/user data APIs).
|
|
629
|
+
|
|
630
|
+
Insecure patterns:
|
|
631
|
+
|
|
632
|
+
* `export const dynamic = 'force-static'` on a route that returns user-specific data. ([Next.js][1])
|
|
633
|
+
* Using `use cache` around a function that queries user-specific data without a per-user cache key. ([Next.js][1])
|
|
634
|
+
* Returning auth/session responses from GET endpoints with caching enabled.
|
|
635
|
+
|
|
636
|
+
Detection hints:
|
|
637
|
+
|
|
638
|
+
* Search for `dynamic = 'force-static'`, `revalidate`, `use cache`, `cacheLife`, `unstable_cache`.
|
|
639
|
+
* Inspect all GET Route Handlers that are cached/static and confirm they only return public data.
|
|
640
|
+
* Confirm that use of `cookies()`/`headers()` (dynamic APIs) is not accidentally removed in ways that make a route static. ([Next.js][1])
|
|
641
|
+
|
|
642
|
+
Fix:
|
|
643
|
+
|
|
644
|
+
* Mark sensitive routes as dynamic and set `Cache-Control: no-store`.
|
|
645
|
+
* Ensure caching keys include user identity if caching is truly needed (and store it in a user-private cache).
|
|
646
|
+
|
|
647
|
+
---
|
|
648
|
+
|
|
649
|
+
### NEXT-FILES-001: User uploads MUST be validated, stored safely, and served safely
|
|
650
|
+
|
|
651
|
+
Severity: Medium
|
|
652
|
+
|
|
653
|
+
Required:
|
|
654
|
+
|
|
655
|
+
* MUST enforce upload size limits at the edge and in application logic.
|
|
656
|
+
* MUST validate file type using allowlists and content checks (not only extension).
|
|
657
|
+
* MUST store uploads outside the `public/` directory (anything under `public/` is served as static content by default).
|
|
658
|
+
* MUST serve potentially active formats safely (`Content-Disposition: attachment`) unless explicitly intended.
|
|
659
|
+
|
|
660
|
+
Insecure patterns:
|
|
661
|
+
|
|
662
|
+
* Accepting arbitrary file types and serving them back inline.
|
|
663
|
+
* Using user-supplied filename as the storage path.
|
|
664
|
+
* Writing uploads into `public/uploads/` and serving them directly.
|
|
665
|
+
|
|
666
|
+
Detection hints:
|
|
667
|
+
|
|
668
|
+
* Search for `formData()` / multipart parsing, `fs.writeFile`, storage SDK usage.
|
|
669
|
+
* Look for any write path under `public/`.
|
|
670
|
+
* Look for “download” endpoints that set `Content-Type: text/html` or serve user files inline.
|
|
671
|
+
|
|
672
|
+
Fix:
|
|
673
|
+
|
|
674
|
+
* Use a dedicated object store (S3/GCS) or a safe server-side directory outside static roots.
|
|
675
|
+
* Generate random server-side filenames; store metadata separately.
|
|
676
|
+
|
|
677
|
+
---
|
|
678
|
+
|
|
679
|
+
### NEXT-PATH-001: Prevent path traversal and unsafe file access
|
|
680
|
+
|
|
681
|
+
Severity: High
|
|
682
|
+
|
|
683
|
+
Required:
|
|
684
|
+
|
|
685
|
+
* MUST NOT use user-controlled strings as filesystem paths.
|
|
686
|
+
* MUST validate and normalize identifiers; use allowlists and safe base directories.
|
|
687
|
+
* MUST avoid reading arbitrary files based on request parameters.
|
|
688
|
+
|
|
689
|
+
Insecure patterns:
|
|
690
|
+
|
|
691
|
+
* `fs.readFile(request.nextUrl.searchParams.get('path'))`
|
|
692
|
+
* `path.join(base, userPath)` without normalization + boundary checks
|
|
693
|
+
|
|
694
|
+
Detection hints:
|
|
695
|
+
|
|
696
|
+
* Search for `fs.` usage in Route Handlers/API Routes.
|
|
697
|
+
* Search for `path.join`/`path.resolve` fed by request params.
|
|
698
|
+
|
|
699
|
+
Fix:
|
|
700
|
+
|
|
701
|
+
* Use opaque IDs that map to server-side stored paths.
|
|
702
|
+
* Enforce that resolved paths remain within an intended base directory.
|
|
703
|
+
* Sanitize and disallow `..` from being used when creating urls
|
|
704
|
+
|
|
705
|
+
---
|
|
706
|
+
|
|
707
|
+
### NEXT-SSRF-001: Outbound requests using user-influenced URLs MUST be restricted
|
|
708
|
+
|
|
709
|
+
Severity: Medium (High in internal networks)
|
|
710
|
+
|
|
711
|
+
NOTE: This is mostly only applicable to apps which will be deployed in a cloud/LAN setup or have other http services on the same box. Sometimes the feature requires this functionality unavoidably (webhooks).
|
|
712
|
+
|
|
713
|
+
Required:
|
|
714
|
+
|
|
715
|
+
* MUST treat any server-side `fetch()` to a user-provided URL as high-risk.
|
|
716
|
+
* SHOULD allowlist destinations (hosts/domains) for URL fetch features.
|
|
717
|
+
* SHOULD block:
|
|
718
|
+
|
|
719
|
+
* localhost / private IP ranges / link-local
|
|
720
|
+
* cloud metadata endpoints
|
|
721
|
+
* MUST restrict protocols to `http:` and `https:`.
|
|
722
|
+
* SHOULD set strict timeouts and restrict redirects.
|
|
723
|
+
|
|
724
|
+
Insecure patterns:
|
|
725
|
+
|
|
726
|
+
* `await fetch(req.query.url)` or `await fetch((await request.json()).url)`
|
|
727
|
+
* “URL preview” endpoints that fetch arbitrary URLs.
|
|
728
|
+
|
|
729
|
+
Detection hints:
|
|
730
|
+
|
|
731
|
+
* Search for `fetch(` in server code and trace where the URL comes from.
|
|
732
|
+
* Look for “webhook tester”, “preview”, “import from URL” features.
|
|
733
|
+
|
|
734
|
+
Fix:
|
|
735
|
+
|
|
736
|
+
* Parse URL, enforce `http/https`, allowlist hostnames, re-resolve DNS/IP to block private ranges.
|
|
737
|
+
* Set timeouts (AbortSignal) and limit redirects.
|
|
738
|
+
|
|
739
|
+
---
|
|
740
|
+
|
|
741
|
+
### NEXT-REDIRECT-001: Prevent open redirects (including auth flows)
|
|
742
|
+
|
|
743
|
+
Severity: Low
|
|
744
|
+
|
|
745
|
+
Required:
|
|
746
|
+
|
|
747
|
+
* MUST validate redirect targets derived from untrusted input (e.g., `next`, `redirect`, `returnTo`).
|
|
748
|
+
* SHOULD prefer redirecting only to same-site relative paths.
|
|
749
|
+
* MUST validate any absolute URL against an allowlist.
|
|
750
|
+
* MUST ensure urls are `http` or `https:` schema, disallowing `javascript:` schema
|
|
751
|
+
|
|
752
|
+
Insecure patterns:
|
|
753
|
+
|
|
754
|
+
* `redirect(searchParams.get('next')!)`
|
|
755
|
+
* `NextResponse.redirect(new URL(req.nextUrl.searchParams.get('to')!, req.url))` without checks
|
|
756
|
+
|
|
757
|
+
Detection hints:
|
|
758
|
+
|
|
759
|
+
* Search for `redirect(` (server components/actions) and `NextResponse.redirect`.
|
|
760
|
+
* Search for `res.redirect(` in API Routes. ([Next.js][3])
|
|
761
|
+
|
|
762
|
+
Fix:
|
|
763
|
+
|
|
764
|
+
* Only allow relative paths (`/path`) and reject protocol-relative (`//evil.com`) or absolute URLs.
|
|
765
|
+
* If invalid, fall back to a safe default (home/dashboard).
|
|
766
|
+
|
|
767
|
+
---
|
|
768
|
+
|
|
769
|
+
### NEXT-CORS-001: CORS must be explicit and least-privilege
|
|
770
|
+
|
|
771
|
+
Severity: Medium (High if misconfigured with credentials)
|
|
772
|
+
|
|
773
|
+
Required:
|
|
774
|
+
|
|
775
|
+
* If CORS is not needed, MUST keep it disabled.
|
|
776
|
+
* Next.js API Routes do not set CORS headers by default, meaning they are same-origin by default; only enable CORS when you truly need it. ([Next.js][3])
|
|
777
|
+
* If enabling CORS:
|
|
778
|
+
|
|
779
|
+
* MUST allowlist trusted origins (no reflection of arbitrary Origin)
|
|
780
|
+
* MUST be careful with credentialed requests (cookies); never combine broad origins with credentials.
|
|
781
|
+
* SHOULD restrict methods and headers.
|
|
782
|
+
|
|
783
|
+
Insecure patterns:
|
|
784
|
+
|
|
785
|
+
* `Access-Control-Allow-Origin: *` with `Access-Control-Allow-Credentials: true`
|
|
786
|
+
* Reflecting `Origin` without validation.
|
|
787
|
+
|
|
788
|
+
Detection hints:
|
|
789
|
+
|
|
790
|
+
* Search for `Access-Control-Allow-Origin`, `cors`, “CORS” middleware/wrappers.
|
|
791
|
+
* Review preflight `OPTIONS` handlers.
|
|
792
|
+
|
|
793
|
+
Fix:
|
|
794
|
+
|
|
795
|
+
* Implement strict origin allowlist and minimal methods/headers.
|
|
796
|
+
* Ensure cookies aren’t exposed cross-origin unless necessary and reviewed.
|
|
797
|
+
|
|
798
|
+
---
|
|
799
|
+
|
|
800
|
+
### NEXT-WEBHOOK-001: Webhook endpoints MUST verify authenticity using the raw body
|
|
801
|
+
|
|
802
|
+
Severity: Medium
|
|
803
|
+
|
|
804
|
+
Required:
|
|
805
|
+
|
|
806
|
+
* MUST verify webhook signatures using the **raw request body** (not a re-serialized parsed object).
|
|
807
|
+
* Next.js notes a use case for disabling body parsing is verifying the raw body of a webhook request. ([Next.js][3])
|
|
808
|
+
|
|
809
|
+
Insecure patterns:
|
|
810
|
+
|
|
811
|
+
* Verifying webhook signatures over `JSON.stringify(req.body)` (can change formatting).
|
|
812
|
+
* Accepting webhooks with no signature verification and no allowlist.
|
|
813
|
+
|
|
814
|
+
Detection hints:
|
|
815
|
+
|
|
816
|
+
* Find webhook endpoints (`/api/webhook`, `/app/api/**/webhook`).
|
|
817
|
+
* Check whether they use raw body verification.
|
|
818
|
+
|
|
819
|
+
Fix:
|
|
820
|
+
|
|
821
|
+
* Disable Next.js automatic body parsing only for those webhook routes, read raw bytes safely, verify signature, then parse.
|
|
822
|
+
|
|
823
|
+
---
|
|
824
|
+
|
|
825
|
+
### NEXT-INJECT-001: Prevent SQL injection (use parameterized queries / ORM)
|
|
826
|
+
|
|
827
|
+
Severity: High
|
|
828
|
+
|
|
829
|
+
Required:
|
|
830
|
+
|
|
831
|
+
* MUST use parameterized queries or an ORM that parameterizes under the hood.
|
|
832
|
+
* MUST NOT build SQL by string concatenation / template strings with untrusted input.
|
|
833
|
+
|
|
834
|
+
Insecure patterns:
|
|
835
|
+
|
|
836
|
+
* ``db.query(`SELECT * FROM users WHERE id = ${id}`)``
|
|
837
|
+
* `"WHERE name = '" + user + "'"`
|
|
838
|
+
|
|
839
|
+
Detection hints:
|
|
840
|
+
|
|
841
|
+
* Grep for `SELECT`, `INSERT`, `UPDATE`, `DELETE` strings.
|
|
842
|
+
* Trace untrusted input (`params`, `searchParams`, `req.query`, `req.body`, `request.json()`) into DB calls.
|
|
843
|
+
|
|
844
|
+
Fix:
|
|
845
|
+
|
|
846
|
+
* Use prepared statements / ORM query APIs.
|
|
847
|
+
* Validate and coerce types before querying.
|
|
848
|
+
|
|
849
|
+
---
|
|
850
|
+
|
|
851
|
+
### NEXT-INJECT-002: Prevent OS command injection and unsafe subprocess use
|
|
852
|
+
|
|
853
|
+
Severity: Critical to High
|
|
854
|
+
|
|
855
|
+
Required:
|
|
856
|
+
|
|
857
|
+
* MUST avoid executing OS commands with attacker-controlled input.
|
|
858
|
+
* If subprocess is necessary:
|
|
859
|
+
|
|
860
|
+
* MUST pass args as an array (not a single shell string)
|
|
861
|
+
* MUST NOT use `shell: true` with attacker-influenced strings
|
|
862
|
+
* SHOULD use strict allowlists for any variable component
|
|
863
|
+
|
|
864
|
+
Insecure patterns:
|
|
865
|
+
|
|
866
|
+
* `exec("convert " + filename)`
|
|
867
|
+
* `spawn("bash", ["-c", userInput])`
|
|
868
|
+
* `spawn(userInput, ["foo"])`
|
|
869
|
+
|
|
870
|
+
Detection hints:
|
|
871
|
+
|
|
872
|
+
* Search for `child_process`, `exec`, `spawn`, `shell: true`.
|
|
873
|
+
|
|
874
|
+
Fix:
|
|
875
|
+
|
|
876
|
+
* Use library APIs instead of shell commands.
|
|
877
|
+
* Hard-code commands and allowlist validated parameters (and use `--` to separate flags where supported).
|
|
878
|
+
|
|
879
|
+
---
|
|
880
|
+
|
|
881
|
+
### NEXT-INJECT-003: Avoid dynamic code execution and unsafe deserialization
|
|
882
|
+
|
|
883
|
+
Severity: High to Critical
|
|
884
|
+
|
|
885
|
+
Required:
|
|
886
|
+
|
|
887
|
+
* MUST NOT use `eval`, `new Function`, `vm.runIn*` on untrusted strings.
|
|
888
|
+
* MUST treat deserializing complex formats (YAML, XML, custom serialization) as risky; use safe parsers and strict schemas.
|
|
889
|
+
|
|
890
|
+
Insecure patterns:
|
|
891
|
+
|
|
892
|
+
* `eval(req.body.code)`
|
|
893
|
+
* Parsing YAML from user input with a non-safe schema.
|
|
894
|
+
|
|
895
|
+
Detection hints:
|
|
896
|
+
|
|
897
|
+
* Search for `eval(`, `new Function`, `vm.`, `require(` with non-literals.
|
|
898
|
+
* Search for `js-yaml`, XML parsers, custom serializer usage on untrusted input.
|
|
899
|
+
|
|
900
|
+
Fix:
|
|
901
|
+
|
|
902
|
+
* Remove dynamic execution; use safe interpreters or strict parsers.
|
|
903
|
+
* Validate and constrain input.
|
|
904
|
+
|
|
905
|
+
---
|
|
906
|
+
|
|
907
|
+
### NEXT-LOG-001: Logging MUST NOT leak secrets or sensitive headers
|
|
908
|
+
|
|
909
|
+
Severity: Medium
|
|
910
|
+
|
|
911
|
+
Required:
|
|
912
|
+
|
|
913
|
+
* MUST NOT log:
|
|
914
|
+
|
|
915
|
+
* `Authorization` headers
|
|
916
|
+
* cookies / session tokens
|
|
917
|
+
* request bodies containing credentials
|
|
918
|
+
* environment variables or configuration dumps
|
|
919
|
+
* SHOULD implement structured logging with redaction.
|
|
920
|
+
|
|
921
|
+
Insecure patterns:
|
|
922
|
+
|
|
923
|
+
* `console.log(req.headers)` in auth endpoints
|
|
924
|
+
* `console.log(process.env)` in server code
|
|
925
|
+
|
|
926
|
+
Detection hints:
|
|
927
|
+
|
|
928
|
+
* Search for `console.log(`, `logger.info(`, `debug(` in server routes/actions.
|
|
929
|
+
* Check for logs of headers/cookies/body.
|
|
930
|
+
|
|
931
|
+
Fix:
|
|
932
|
+
|
|
933
|
+
* Redact sensitive fields; log only what is needed for debugging.
|
|
934
|
+
* Use safe error messages for clients; keep detail server-side only.
|
|
935
|
+
|
|
936
|
+
---
|
|
937
|
+
|
|
938
|
+
### NEXT-ERROR-001: Error handling MUST avoid leaking implementation details in production
|
|
939
|
+
|
|
940
|
+
Severity: Low
|
|
941
|
+
|
|
942
|
+
Required:
|
|
943
|
+
|
|
944
|
+
* MUST not expose stack traces or internal error details to end users in production.
|
|
945
|
+
* Ensure production mode behavior (Next.js production error handling differs from dev). ([Next.js][6])
|
|
946
|
+
|
|
947
|
+
Insecure patterns:
|
|
948
|
+
|
|
949
|
+
* Returning `err.stack` in JSON responses.
|
|
950
|
+
* Showing detailed exception data to unauthenticated users.
|
|
951
|
+
|
|
952
|
+
Detection hints:
|
|
953
|
+
|
|
954
|
+
* Search for `res.status(500).json(err)` or `return Response.json(err)`.
|
|
955
|
+
* Verify error responses are sanitized.
|
|
956
|
+
|
|
957
|
+
Fix:
|
|
958
|
+
|
|
959
|
+
* Return generic error messages to clients; log details server-side with redaction.
|
|
960
|
+
|
|
961
|
+
---
|
|
962
|
+
|
|
963
|
+
### NEXT-PROXY-001: Proxy/Middleware must not introduce header smuggling or unsafe header forwarding
|
|
964
|
+
|
|
965
|
+
Severity: Medium
|
|
966
|
+
|
|
967
|
+
Required:
|
|
968
|
+
|
|
969
|
+
* MUST be careful when copying/forwarding request headers upstream:
|
|
970
|
+
|
|
971
|
+
* Do not forward attacker-controlled `x-forwarded-*` headers unless you have a trusted proxy chain.
|
|
972
|
+
* Do not forward `Authorization`/cookies to unrelated outbound services.
|
|
973
|
+
* Next.js Proxy patterns often mutate headers; ensure this doesn’t create security issues.
|
|
974
|
+
|
|
975
|
+
Insecure patterns:
|
|
976
|
+
|
|
977
|
+
* Blindly cloning all request headers to an outbound `fetch()` call.
|
|
978
|
+
* Trusting `x-forwarded-host` or `host` to construct sensitive absolute URLs without allowlisting.
|
|
979
|
+
|
|
980
|
+
Detection hints:
|
|
981
|
+
|
|
982
|
+
* Search `headers()` and `request.headers` usage (especially for URL building). ([Next.js][4])
|
|
983
|
+
* Search Proxy/Middleware for header rewrites.
|
|
984
|
+
|
|
985
|
+
Fix:
|
|
986
|
+
|
|
987
|
+
* Allowlist forwarded headers explicitly.
|
|
988
|
+
* Validate hostnames before using them to build callback URLs or redirects.
|
|
989
|
+
|
|
990
|
+
---
|
|
991
|
+
|
|
992
|
+
### NEXT-HOST-001: Host/Origin-derived URL construction MUST be allowlisted
|
|
993
|
+
|
|
994
|
+
Severity: Medium
|
|
995
|
+
|
|
996
|
+
Required:
|
|
997
|
+
|
|
998
|
+
* MUST NOT generate security-sensitive absolute URLs (password reset links, OAuth callback URLs, email verification links) directly from unvalidated `Host` headers.
|
|
999
|
+
* For Server Actions, Origin/Host matching is part of CSRF mitigation; do not weaken it. ([Next.js][5])
|
|
1000
|
+
|
|
1001
|
+
Insecure patterns:
|
|
1002
|
+
|
|
1003
|
+
* `const base = "https://" + request.headers.get("host")`
|
|
1004
|
+
* Using unvalidated `x-forwarded-host` for absolute URL generation.
|
|
1005
|
+
|
|
1006
|
+
Detection hints:
|
|
1007
|
+
|
|
1008
|
+
* Grep for `.get('host')`, `.get('x-forwarded-host')`, and absolute URL building.
|
|
1009
|
+
* Review auth-related email link generation code.
|
|
1010
|
+
|
|
1011
|
+
Fix:
|
|
1012
|
+
|
|
1013
|
+
* Use a configured, allowlisted canonical app origin (e.g., `APP_ORIGIN=https://example.com`).
|
|
1014
|
+
* Allowlist hostnames; fail closed.
|
|
1015
|
+
|
|
1016
|
+
---
|
|
1017
|
+
|
|
1018
|
+
### NEXT-DOS-001: Rate limiting and resource controls MUST exist for abuse-prone endpoints
|
|
1019
|
+
|
|
1020
|
+
Severity: Medium
|
|
1021
|
+
|
|
1022
|
+
Required:
|
|
1023
|
+
|
|
1024
|
+
* SHOULD implement rate limiting/throttling for:
|
|
1025
|
+
|
|
1026
|
+
* login, password reset, signup
|
|
1027
|
+
* expensive Server Actions
|
|
1028
|
+
* webhook ingestion
|
|
1029
|
+
* MUST implement request size limits (see NEXT-LIMITS-001).
|
|
1030
|
+
* If self-hosting, MUST rely on reverse proxy for additional protections. ([Next.js][8])
|
|
1031
|
+
|
|
1032
|
+
Insecure patterns:
|
|
1033
|
+
|
|
1034
|
+
* No throttling on login/reset endpoints.
|
|
1035
|
+
* Expensive actions callable without auth or with unlimited frequency.
|
|
1036
|
+
|
|
1037
|
+
Detection hints:
|
|
1038
|
+
|
|
1039
|
+
* Identify auth endpoints and check for rate limiting.
|
|
1040
|
+
* Search for “send email”, “charge”, “generate report” flows.
|
|
1041
|
+
|
|
1042
|
+
Fix:
|
|
1043
|
+
|
|
1044
|
+
* Add edge rate limiting and app-level user/IP throttles.
|
|
1045
|
+
* Add job queues for heavy work; return 202 when appropriate.
|
|
1046
|
+
|
|
1047
|
+
---
|
|
1048
|
+
|
|
1049
|
+
## 5) Practical scanning heuristics (how to “hunt”)
|
|
1050
|
+
|
|
1051
|
+
When actively scanning, use these high-signal patterns:
|
|
1052
|
+
|
|
1053
|
+
* Production misconfig:
|
|
1054
|
+
|
|
1055
|
+
* `next dev`, `NODE_ENV=development`, dev-only start commands ([Next.js][7])
|
|
1056
|
+
* Secrets exposure:
|
|
1057
|
+
|
|
1058
|
+
* `.env` committed, `NEXT_PUBLIC_` on sensitive variables ([Next.js][7])
|
|
1059
|
+
* `process.env` used in `"use client"` modules
|
|
1060
|
+
* Auth coverage:
|
|
1061
|
+
|
|
1062
|
+
* `app/**/route.ts` or `pages/api/**` with no auth checks ([Next.js][1])
|
|
1063
|
+
* `"use server"` actions with DB writes and no authz ([Next.js][6])
|
|
1064
|
+
* `proxy.ts` / `middleware.ts` matchers that exclude sensitive routes ([Next.js][12])
|
|
1065
|
+
* CSRF:
|
|
1066
|
+
|
|
1067
|
+
* cookie-auth POST/PUT/PATCH/DELETE with no token/origin checks
|
|
1068
|
+
* `serverActions.allowedOrigins` too broad ([Next.js][5])
|
|
1069
|
+
* XSS:
|
|
1070
|
+
|
|
1071
|
+
* `dangerouslySetInnerHTML`, raw HTML markdown rendering
|
|
1072
|
+
* missing CSP / overly permissive CSP ([Next.js][7])
|
|
1073
|
+
* Caching/data leak:
|
|
1074
|
+
|
|
1075
|
+
* `dynamic = 'force-static'` on sensitive GET handlers ([Next.js][1])
|
|
1076
|
+
* `use cache`, `cacheLife`, `unstable_cache` around user-specific data ([Next.js][1])
|
|
1077
|
+
* Files:
|
|
1078
|
+
|
|
1079
|
+
* writing uploads under `public/`
|
|
1080
|
+
* `fs.readFile` / `path.join` with request input
|
|
1081
|
+
* SSRF:
|
|
1082
|
+
|
|
1083
|
+
* `fetch(userProvidedUrl)` from Route Handlers / Server Actions
|
|
1084
|
+
* Redirect:
|
|
1085
|
+
|
|
1086
|
+
* `redirect(searchParams.get('next'))`, `NextResponse.redirect(...)`, `res.redirect(req.query.next)` ([Next.js][3])
|
|
1087
|
+
* CORS:
|
|
1088
|
+
|
|
1089
|
+
* wildcard origins, origin reflection, credentials + broad origins ([Next.js][3])
|
|
1090
|
+
* Limits:
|
|
1091
|
+
|
|
1092
|
+
* API routes with `bodyParser: false` and no raw-body verification for webhooks ([Next.js][3])
|
|
1093
|
+
* `serverActions.bodySizeLimit` raised without justification ([Next.js][5])
|
|
1094
|
+
* Dependency hygiene:
|
|
1095
|
+
|
|
1096
|
+
* old `next` versions that conflict with support policy/advisories ([Next.js][10])
|
|
1097
|
+
|
|
1098
|
+
Always try to confirm:
|
|
1099
|
+
|
|
1100
|
+
* data origin (untrusted vs trusted)
|
|
1101
|
+
* sink type (HTML/DOM, SQL, subprocess, files, redirect, outbound HTTP)
|
|
1102
|
+
* protective controls present (schema validation, allowlists, middleware/proxy checks, authz helpers, edge protections)
|
|
1103
|
+
|
|
1104
|
+
---
|
|
1105
|
+
|
|
1106
|
+
## 6) Sources (accessed 2026-01-27)
|
|
1107
|
+
|
|
1108
|
+
Primary framework documentation (Next.js):
|
|
1109
|
+
|
|
1110
|
+
* Next.js Docs: Installation (system requirements / Node version) — `https://nextjs.org/docs/app/getting-started/installation`
|
|
1111
|
+
* Next.js Docs: Route Handlers — `https://nextjs.org/docs/app/getting-started/route-handlers`
|
|
1112
|
+
* Next.js Docs: API Routes (Pages Router) — `https://nextjs.org/docs/pages/building-your-application/routing/api-routes`
|
|
1113
|
+
* Next.js Docs: Environment Variables — `https://nextjs.org/docs/pages/guides/environment-variables`
|
|
1114
|
+
* Next.js Docs: Data Security — `https://nextjs.org/docs/app/guides/data-security`
|
|
1115
|
+
* Next.js Docs: Content Security Policy — `https://nextjs.org/docs/app/guides/content-security-policy`
|
|
1116
|
+
* Next.js Docs: Proxy — `https://nextjs.org/docs/app/getting-started/proxy`
|
|
1117
|
+
* Next.js Docs: `serverActions.allowedOrigins` and `serverActions.bodySizeLimit` — `https://nextjs.org/docs/app/api-reference/config/next-config-js/serverActions`
|
|
1118
|
+
* Next.js Docs: `cookies()` — `https://nextjs.org/docs/app/api-reference/functions/cookies`
|
|
1119
|
+
* Next.js Docs: `headers()` — `https://nextjs.org/docs/app/api-reference/functions/headers`
|
|
1120
|
+
* Next.js Docs: Self-hosting (reverse proxy guidance) — `https://nextjs.org/docs/pages/guides/self-hosting`
|
|
1121
|
+
* Next.js Docs: Support policy (supported versions/LTS) — `https://nextjs.org/docs/support-policy`
|
|
1122
|
+
|
|
1123
|
+
Next.js security guidance & advisories:
|
|
1124
|
+
|
|
1125
|
+
* Next.js Blog: How to think about security in Next.js — `https://nextjs.org/blog/security-nextjs-server-components-actions`
|
|
1126
|
+
* GitHub Security Advisory: Next.js DoS via Server Components / Server Actions (CVE-2026-23864) — `https://github.com/advisories/GHSA-fq29-rrrv-cq2m`
|
|
1127
|
+
* Next.js Blog: Security update (example security advisory context) — `https://nextjs.org/blog/security-update`
|
|
1128
|
+
|
|
1129
|
+
General web security references (recommended baseline):
|
|
1130
|
+
|
|
1131
|
+
* OWASP Cheat Sheet Series (CSRF, Session Management, XSS Prevention, SSRF Prevention, File Upload, HTTP Headers) — `https://cheatsheetseries.owasp.org/`
|
|
1132
|
+
|
|
1133
|
+
[1]: https://nextjs.org/docs/app/getting-started/route-handlers "Getting Started: Route Handlers | Next.js"
|
|
1134
|
+
[2]: https://nextjs.org/docs/app/getting-started/deploying?utm_source=chatgpt.com "Getting Started: Deploying"
|
|
1135
|
+
[3]: https://nextjs.org/docs/pages/building-your-application/routing/api-routes "Routing: API Routes | Next.js"
|
|
1136
|
+
[4]: https://nextjs.org/docs/app/api-reference/functions/headers "Functions: headers | Next.js"
|
|
1137
|
+
[5]: https://nextjs.org/docs/app/api-reference/config/next-config-js/serverActions "next.config.js: serverActions | Next.js"
|
|
1138
|
+
[6]: https://nextjs.org/blog/security-nextjs-server-components-actions "How to Think About Security in Next.js | Next.js"
|
|
1139
|
+
[7]: https://nextjs.org/docs/pages/guides/environment-variables "Guides: Environment Variables | Next.js"
|
|
1140
|
+
[8]: https://nextjs.org/docs/pages/guides/self-hosting?utm_source=chatgpt.com "Guides: Self-Hosting"
|
|
1141
|
+
[9]: https://nextjs.org/docs/app/api-reference/functions/cookies "Functions: cookies | Next.js"
|
|
1142
|
+
[10]: https://nextjs.org/blog/next-16?utm_source=chatgpt.com "Next.js 16"
|
|
1143
|
+
[11]: https://github.com/vercel/next.js/security/advisories/GHSA-9g9p-9gw9-jx7f?utm_source=chatgpt.com "Denial of Service in Image Optimizer · Advisory"
|
|
1144
|
+
[12]: https://nextjs.org/docs/pages/guides/authentication "Guides: Authentication | Next.js"
|