Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement better and more consistent incoming message validation in all message handlers #177

Open
turbocrime opened this issue Aug 24, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation refactor Improving existing system with new design security

Comments

@turbocrime
Copy link
Contributor

turbocrime commented Aug 24, 2024

Message listeners perform inconsistent validation of incoming messages, and test coverage is poor.

different listeners may validate input with

  • type guards
  • helper functions
  • string literal comparison
  • an enumerated switch
  • object inspection code directly in the handler

Type guards tend to be colocated with message type definitions, so are not obviously critical to message validation in listeners. These should be documented and called out with docstrings.

Object inspection code inside handlers should be converted to type guards with docstrings, and relocated with the message types.

Some existing helper methods could be applied more broadly.

Some validation functions have test coverage, but presently, all listeners and type guards have zero test coverage. These paths are security critical and should have full test coverage, with special attention to:

  • malformed input
  • input that satisfies multiple types
  • listeners expecting input from specific sources
@turbocrime turbocrime added bug Something isn't working security refactor Improving existing system with new design labels Aug 24, 2024
@github-project-automation github-project-automation bot moved this to 🗄️ Backlog in Labs web Aug 24, 2024
@turbocrime turbocrime added documentation Improvements or additions to documentation and removed bug Something isn't working labels Aug 24, 2024
@grod220 grod220 moved this from 🗄️ Backlog to 📝 Todo in Labs web Aug 26, 2024
@grod220 grod220 moved this from 🏗 In progress to 🗄️ Backlog in Labs web Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation refactor Improving existing system with new design security
Projects
Status: 🗄️ Backlog
Development

No branches or pull requests

1 participant