mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-05-14 19:35:18 +00:00
fixes: add DNS timeout, removed duplicate import, added OS-aware path validation, used centralized validation function for pubkey, made sanitize input length limit configurable, used explicit base directory, added a few type hints.
This commit is contained in:
@@ -273,8 +273,10 @@ class MessageHandler:
|
||||
break
|
||||
|
||||
# Sanitize message content to prevent injection attacks
|
||||
# Note: Firmware enforces 150-char limit at hardware level, so we disable length check
|
||||
# but still strip control characters for security
|
||||
message_content = payload.get('text', '')
|
||||
message_content = sanitize_input(message_content, max_length=500, strip_controls=True)
|
||||
message_content = sanitize_input(message_content, max_length=None, strip_controls=True)
|
||||
|
||||
# Convert to our message format
|
||||
message = MeshMessage(
|
||||
|
||||
Reference in New Issue
Block a user