feat: security hardening, DB indexes, token revocation, and input validation
- SSRF protection: DNS resolution + private IP blocking on metadata fetcher - Upload security: CSP/X-Frame-Options headers, SVG forced download, nosniff - Auth hardening: JWT secret min length, password min 8 chars, token revocation via password_changed_at - Attachment ownership verification before linking to messages - Message length limit (4000 chars) enforced on client and server - Asset URL validation on avatar/banner updates - Federation instance validation (domain regex, origin scheme, length limits) - DB indexes on all FK columns for query performance - Migrations: nullable moderator columns, dm_messages reply_to FK constraint - File cleanup on avatar/banner replacement and space deletion - Fastify trustProxy, AbortController on fetches, typing map size cap
This commit is contained in:
@@ -18,7 +18,7 @@ import { MemberListToggleButton } from './MemberListToggleButton';
|
||||
import { isSelf } from '../../utils/identity';
|
||||
import { joinVoiceChannel } from '../../utils/voice';
|
||||
import { SearchPopover } from '../chat/SearchPopover';
|
||||
import { isDmChannel } from '../../stores/spaceStore';
|
||||
import { isDmChannel, getChannelOrigin } from '../../stores/spaceStore';
|
||||
|
||||
export function MainContent() {
|
||||
// 1. ALL HOOKS AT THE TOP
|
||||
@@ -93,13 +93,13 @@ export function MainContent() {
|
||||
const handleStartVoiceCall = () => {
|
||||
if (!currentChannelId) return;
|
||||
useVoiceStore.getState().setOutgoingCall({ dmChannelId: currentChannelId });
|
||||
wsSend({ type: 'dm_call_start', dmChannelId: currentChannelId });
|
||||
wsSend({ type: 'dm_call_start', dmChannelId: currentChannelId }, getChannelOrigin(currentChannelId));
|
||||
};
|
||||
|
||||
const handleCancelCall = () => {
|
||||
if (!currentChannelId) return;
|
||||
useVoiceStore.getState().setOutgoingCall(null);
|
||||
wsSend({ type: 'dm_call_end', dmChannelId: currentChannelId });
|
||||
wsSend({ type: 'dm_call_end', dmChannelId: currentChannelId }, getChannelOrigin(currentChannelId));
|
||||
};
|
||||
|
||||
if (isInDmCall) {
|
||||
|
||||
Reference in New Issue
Block a user