Skip to content

[WIP] Raw User Input: /project/metadata route#315

Closed
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-314
Closed

[WIP] Raw User Input: /project/metadata route#315
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-314

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 12, 2025

Adding middleware to protect /project/metadata route from malicious user input.

Plan for implementing the checkIfSuspicious middleware:

  • Analyze the current /project/metadata route structure (lines 571-595 in project/index.js)
  • Examine existing input validation patterns in the codebase
  • Review current middleware patterns (auth0Middleware)
  • Create the checkIfSuspicious.js middleware in utilities directory
  • Implement input validation for metadata arrays with 'label' and 'value' properties
  • Add the middleware to the PUT /project/metadata route
  • Test the implementation to ensure it works correctly
  • Verify no existing functionality is broken

Current route accepts metadata as req.body (array of objects) and passes it directly to projectObj.updateMetadata() without validation. The middleware will sanitize/validate this input before processing.

Fixes #314.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@thehabes thehabes closed this Sep 12, 2025
Copilot AI requested a review from thehabes September 12, 2025 17:37
Copilot stopped work on behalf of thehabes due to an error September 12, 2025 17:37
@thehabes thehabes deleted the copilot/fix-314 branch September 12, 2025 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Raw User Input: /project/metadata route

2 participants