mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-29 08:00:06 +00:00
fix(collab): harden the link preview fetcher (#2058)
The preview endpoint takes a URL from whoever is typing in a trip chat and fetches it from the server. Trip access was added to it earlier; this is the rest of what that route needed. The SSRF guard had a hole under it. `isAlwaysBlocked` knew `::1` and `0.0.0.0` but not the IPv6 unspecified address: `::` starts with a colon, so the `0.` check never saw it, and connecting to it lands on loopback. `http://[::]:9200/` therefore passed the guard and came back with the target's title and og: tags scraped out of the body — an exfiltrating read of anything listening locally, from any account. `[::0]`, `[0:0:0:0:0:0:0:0]` and `[::ffff:0:0]` are the same address in other spellings and behaved the same way. The two `::ffff:`-prefix regexes had the same shape of gap: they matched the dotted spelling of loopback and link-local, so `::ffff:7f00:1` walked past them. Both checks now decide on the expanded hextets, which covers every spelling at once, and fe80::/10 is read as ten bits rather than as the four characters 'fe80'. This is in ssrfGuard, so every caller gets it, not just collab. The scrape could be turned into a denial of service. Each og: regex had two unbounded `[^>]*` runs separated by a literal, so a document with no `>` in it made the engine rescan the remainder from every `<meta` it passed — quadratic, and the byte cap admits half a megabyte. Measured on this build: 240KB of '<meta ' took 58 seconds, and Node has one thread, so that is the entire server, health check included, on one request. Bounding the runs at 512 characters makes it linear (540KB now takes 1.4s); no real attribute list comes close to that. The five-second timeout only covered the headers — `clearTimeout` ran before the body was read — so a server that answered fast and then dripped one byte every few seconds held the handler, the socket and the per-request undici agent open indefinitely. The byte cap counts bytes and at that rate would never reach one. `AbortSignal.timeout` covers both halves, the agent is closed in a `finally`, and the three bail-outs that used to return without touching the body now discard it, which is what cappedFetch's helper is there for. The rest is smaller. Nothing metered the fetches, so an account with a trip of its own could drive arbitrary outbound requests in a loop; there is a budget of sixty new fetches a minute per user now, charged per outbound fetch rather than per request. Previews are cached for ten minutes and simultaneous askers for one URL share a single fetch, so the client's habit of requesting a preview per rendered message — up to a hundred at once, with no debounce — costs one fetch per new link rather than one per render. Refusals answer with one constant reason instead of the guard's own: it distinguishes "could not resolve" from "private address", which together map out the server's internal DNS for anyone willing to guess hostnames. A body whose declared type is not markup is dropped rather than combed for og: tags, and an og:image that is not an http(s) URL is not passed to the client, which puts it straight into an <img src>. Deliberately no `@RequirePermission` on the route: the client asks for a preview while rendering a message or a note, never while composing one, so it belongs with the GET siblings. Requiring collab_edit would blank every preview for members of a trip whose owner narrowed that right while leaving them able to read the chat, and it would not stop the abuse it looks like it addresses — the permission check passes for a trip's owner at every level, and anyone can create a trip.
This commit is contained in:
@@ -299,6 +299,13 @@ export class CollabController {
|
||||
}
|
||||
|
||||
// ── Link preview ──────────────────────────────────────────────────────────
|
||||
// Deliberately no @RequirePermission: this is a read path. The client asks for
|
||||
// a preview while *rendering* a message or a note (CollabChatMessages,
|
||||
// CollabNotesCard), never while composing one, so it belongs with the GET
|
||||
// siblings above — requiring 'collab_edit' would strip every preview from a
|
||||
// trip whose owner has narrowed that right, for people who may still read the
|
||||
// chat. What keeps the fetcher from being a free outbound proxy is the budget
|
||||
// inside the service, not a write permission.
|
||||
@UseGuards(TripAccessGuard)
|
||||
@Get('link-preview')
|
||||
async linkPreview(@CurrentUser() user: User, @Param('tripId') tripId: string, @Query('url') url?: string) {
|
||||
@@ -308,10 +315,12 @@ export class CollabController {
|
||||
throw new HttpException({ error: 'URL is required' }, 400);
|
||||
}
|
||||
try {
|
||||
const preview = await this.collab.linkPreview(url);
|
||||
const asRecord = preview as { error?: string };
|
||||
if (asRecord.error) {
|
||||
throw new HttpException({ error: asRecord.error }, 400);
|
||||
const preview = await this.collab.linkPreview(url, user.id);
|
||||
if (preview.rateLimited) {
|
||||
throw new HttpException({ error: 'Too many requests' }, 429);
|
||||
}
|
||||
if (preview.error) {
|
||||
throw new HttpException({ error: preview.error }, 400);
|
||||
}
|
||||
return preview;
|
||||
} catch (err) {
|
||||
|
||||
@@ -14,6 +14,7 @@ import { McpSharedModule } from '../mcp-shared/mcp-shared.module';
|
||||
import { StorageModule } from '../storage/storage.module';
|
||||
import { StorageService } from '../storage/storage.service';
|
||||
import { buildStorageUploadOptions } from '../storage/storage-upload.factory';
|
||||
import { RateLimitModule } from '../common/rate-limit.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
@@ -29,7 +30,7 @@ import { buildStorageUploadOptions } from '../storage/storage-upload.factory';
|
||||
}),
|
||||
}),
|
||||
StorageModule,
|
||||
McpSharedModule, NotificationsModule, PermissionsModule, AuthModule, RealtimeModule, PluginGuardsModule, AddonsModule],
|
||||
McpSharedModule, NotificationsModule, PermissionsModule, AuthModule, RealtimeModule, PluginGuardsModule, AddonsModule, RateLimitModule],
|
||||
controllers: [CollabController],
|
||||
providers: [CollabService, CollabMcp, CollabRpc],
|
||||
// For in-container consumers (CollabRpc).
|
||||
|
||||
@@ -6,10 +6,11 @@ import { RealtimeService } from '../realtime/realtime.service';
|
||||
import { PermissionsService } from '../permissions/permissions.service';
|
||||
import { avatarUrl } from '../common/avatarUrl';
|
||||
import { checkSsrf, createPinnedDispatcher } from '../../utils/ssrfGuard';
|
||||
import { exceedsDeclaredLength, readCappedText } from '../../utils/cappedFetch';
|
||||
import { discardBody, exceedsDeclaredLength, readCappedText } from '../../utils/cappedFetch';
|
||||
import type { CollabNote, CollabPoll, CollabMessage, TripFile, User } from '../../types';
|
||||
import { NotificationsService } from '../notifications/notifications.service';
|
||||
import { StorageService } from '../storage/storage.service';
|
||||
import { RateLimitService } from '../common/rate-limit.service';
|
||||
|
||||
type Trip = TripAccess;
|
||||
|
||||
@@ -51,6 +52,56 @@ export interface LinkPreviewResult {
|
||||
image: string | null;
|
||||
site_name?: string | null;
|
||||
url: string;
|
||||
/** Set when the URL was refused; the controller turns it into a 400. */
|
||||
error?: string;
|
||||
/** Set when the caller is out of preview fetches; the controller turns it into a 429. */
|
||||
rateLimited?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Outbound fetches one user may trigger per minute. Deliberately generous: the
|
||||
* client asks for a preview per rendered message (`LIMIT 100`) and per note with
|
||||
* a website, both without debounce, so opening a link-heavy trip is a burst of
|
||||
* dozens. Cache hits are not charged, so this only ever meters *new* URLs.
|
||||
*/
|
||||
const PREVIEW_FETCHES_PER_MINUTE = 60;
|
||||
|
||||
/** How long a scraped preview stays good. og: tags are near-static. */
|
||||
const PREVIEW_CACHE_TTL_MS = 10 * 60 * 1000;
|
||||
|
||||
/** Entries kept before the least recently used one is dropped. */
|
||||
const PREVIEW_CACHE_MAX = 500;
|
||||
|
||||
/**
|
||||
* Pulls the og:/<title>/description fields out of a document.
|
||||
*
|
||||
* Every `[^>]` run is bounded. Unbounded, two of them separated by a literal make
|
||||
* the engine rescan the rest of the document from every `<meta` it passes, which
|
||||
* is quadratic: a page of `'<meta '` with no `>` in it took ~58s at 240KB on the
|
||||
* measured build, and the cap admits half a megabyte. Node runs one thread, so
|
||||
* that is the whole server — WebSocket, auth and health included — for one
|
||||
* request. No real attribute list comes close to 512 characters.
|
||||
*/
|
||||
function scrapeOpenGraph(html: string): Omit<LinkPreviewResult, 'url'> {
|
||||
const og = (prop: string) => {
|
||||
const m = html.match(new RegExp(`<meta[^>]{0,512}property=["']og:${prop}["'][^>]{0,512}content=["']([^"']*)["']`, 'i'))
|
||||
|| html.match(new RegExp(`<meta[^>]{0,512}content=["']([^"']*)["'][^>]{0,512}property=["']og:${prop}["']`, 'i'));
|
||||
return m ? m[1] : null;
|
||||
};
|
||||
const titleTag = html.match(/<title[^>]{0,512}>([^<]*)<\/title>/i);
|
||||
const descMeta = html.match(/<meta[^>]{0,512}name=["']description["'][^>]{0,512}content=["']([^"']*)["']/i)
|
||||
|| html.match(/<meta[^>]{0,512}content=["']([^"']*)["'][^>]{0,512}name=["']description["']/i);
|
||||
const image = og('image');
|
||||
|
||||
return {
|
||||
title: og('title') || (titleTag ? titleTag[1].trim() : null),
|
||||
description: og('description') || (descMeta ? descMeta[1].trim() : null),
|
||||
// The client renders this straight into an <img src>, so the page being
|
||||
// previewed must not be able to point that at anything but a web address —
|
||||
// the same scheme pin placeImageUrlSchema applies to a stored place picture.
|
||||
image: image && /^https?:\/\//i.test(image) ? image : null,
|
||||
site_name: og('site_name') || null,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,8 +126,23 @@ export class CollabService {
|
||||
private readonly realtime: RealtimeService,
|
||||
private readonly notifications: NotificationsService,
|
||||
private readonly storage: StorageService,
|
||||
private readonly rateLimit: RateLimitService,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Scraped previews, keyed by URL and ordered least-recently-used first.
|
||||
*
|
||||
* On the service rather than at module scope so a test gets a fresh one per
|
||||
* container. What it buys: the client re-requests every preview it renders on
|
||||
* each mount, so without it a reload of a busy trip is another hundred outbound
|
||||
* fetches — the exact traffic the budget above is meant to stop the server from
|
||||
* emitting on someone else's behalf.
|
||||
*/
|
||||
private readonly previewCache = new Map<string, { at: number; result: LinkPreviewResult }>();
|
||||
|
||||
/** Preview fetches currently in flight, so simultaneous askers share one request. */
|
||||
private readonly inFlight = new Map<string, Promise<LinkPreviewResult>>();
|
||||
|
||||
verifyTripAccess(tripId: string | number, userId: number) {
|
||||
return this.db.canAccessTrip(tripId, userId);
|
||||
}
|
||||
@@ -461,60 +527,114 @@ export class CollabService {
|
||||
/* Link preview */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
async linkPreview(url: string): Promise<LinkPreviewResult> {
|
||||
async linkPreview(url: string, userId?: number): Promise<LinkPreviewResult> {
|
||||
const fallback: LinkPreviewResult = { title: null, description: null, image: null, url };
|
||||
|
||||
// A malformed URL returns the fallback directly (the legacy code let
|
||||
// `new URL` throw and relied on the controller's catch for the same 200).
|
||||
try { new URL(url); } catch { return fallback; }
|
||||
|
||||
// Served before the budget is charged: opening a chat re-requests every
|
||||
// preview it renders, so a reload must not cost the caller its allowance.
|
||||
const cached = this.readPreviewCache(url);
|
||||
if (cached) return cached;
|
||||
|
||||
// A fetch for this URL is already on its way. The client renders one preview
|
||||
// per message and does not deduplicate, so the same link posted twenty times
|
||||
// arrives as twenty simultaneous requests — none of which would find a cache
|
||||
// entry yet, since the first has not answered. Joining the running fetch keeps
|
||||
// that a single outbound request instead of twenty.
|
||||
const running = this.inFlight.get(url);
|
||||
if (running) return { ...(await running), url };
|
||||
|
||||
// Charged per outbound fetch rather than per request, which is what the
|
||||
// budget is actually protecting. Without a user there is no one to charge —
|
||||
// no caller passes that today, and the fetch stays behind the SSRF guard.
|
||||
if (userId !== undefined && !this.rateLimit.check('collab_link_preview', String(userId), PREVIEW_FETCHES_PER_MINUTE, 60_000, Date.now())) {
|
||||
return { ...fallback, rateLimited: true };
|
||||
}
|
||||
|
||||
const task = this.fetchPreview(url, fallback);
|
||||
this.inFlight.set(url, task);
|
||||
try {
|
||||
return await task;
|
||||
} finally {
|
||||
this.inFlight.delete(url);
|
||||
}
|
||||
}
|
||||
|
||||
/** The outbound half of linkPreview, past the cache and the budget. */
|
||||
private async fetchPreview(url: string, fallback: LinkPreviewResult): Promise<LinkPreviewResult> {
|
||||
const ssrf = await checkSsrf(url, true);
|
||||
if (!ssrf.allowed) {
|
||||
return { ...fallback, error: ssrf.error } as LinkPreviewResult & { error?: string };
|
||||
// The caller learns that the URL was refused, never why: the three distinct
|
||||
// reasons ("could not resolve", "private address", "loopback") would together
|
||||
// map out the server's internal DNS for anyone willing to guess hostnames.
|
||||
return { ...fallback, error: 'URL not allowed' };
|
||||
}
|
||||
|
||||
const dispatcher = createPinnedDispatcher(ssrf.resolvedIp!);
|
||||
try {
|
||||
const controller = new AbortController();
|
||||
const timeout = setTimeout(() => controller.abort(), 5000);
|
||||
|
||||
try {
|
||||
const r = await fetch(url, {
|
||||
redirect: 'error',
|
||||
signal: controller.signal,
|
||||
dispatcher: createPinnedDispatcher(ssrf.resolvedIp!),
|
||||
headers: { 'User-Agent': 'Mozilla/5.0 (compatible; NOMAD/1.0; +https://github.com/mauriceboe/NOMAD)' },
|
||||
} as any);
|
||||
clearTimeout(timeout);
|
||||
if (!r.ok) throw new Error('Fetch failed');
|
||||
if (exceedsDeclaredLength(r, MAX_PREVIEW_BYTES)) return fallback;
|
||||
|
||||
// A truncated head still carries the tags we scrape, so a page over the
|
||||
// budget degrades to fewer fields rather than to an error.
|
||||
const { text: html } = await readCappedText(r, MAX_PREVIEW_BYTES);
|
||||
const get = (prop: string) => {
|
||||
const m = html.match(new RegExp(`<meta[^>]*property=["']og:${prop}["'][^>]*content=["']([^"']*)["']`, 'i'))
|
||||
|| html.match(new RegExp(`<meta[^>]*content=["']([^"']*)["'][^>]*property=["']og:${prop}["']`, 'i'));
|
||||
return m ? m[1] : null;
|
||||
};
|
||||
const titleTag = html.match(/<title[^>]*>([^<]*)<\/title>/i);
|
||||
const descMeta = html.match(/<meta[^>]*name=["']description["'][^>]*content=["']([^"']*)["']/i)
|
||||
|| html.match(/<meta[^>]*content=["']([^"']*)["'][^>]*name=["']description["']/i);
|
||||
|
||||
return {
|
||||
title: get('title') || (titleTag ? titleTag[1].trim() : null),
|
||||
description: get('description') || (descMeta ? descMeta[1].trim() : null),
|
||||
image: get('image') || null,
|
||||
site_name: get('site_name') || null,
|
||||
url,
|
||||
};
|
||||
} catch {
|
||||
clearTimeout(timeout);
|
||||
return fallback;
|
||||
// AbortSignal.timeout covers the body as well. The hand-rolled controller
|
||||
// this replaces was cleared as soon as the headers arrived, so a server that
|
||||
// answered fast and then dripped the body one byte at a time held the handler,
|
||||
// the socket and this dispatcher open indefinitely — the byte cap counts
|
||||
// bytes, and at that rate it would never reach one.
|
||||
const r = await fetch(url, {
|
||||
redirect: 'error',
|
||||
signal: AbortSignal.timeout(5000),
|
||||
dispatcher,
|
||||
headers: { 'User-Agent': 'Mozilla/5.0 (compatible; NOMAD/1.0; +https://github.com/mauriceboe/NOMAD)' },
|
||||
} as any);
|
||||
if (!r.ok) { discardBody(r); return this.cachePreview(url, fallback); }
|
||||
// Only markup is worth scraping. A declared type that is not HTML means the
|
||||
// regexes below would comb a video or an archive for og: tags and find nothing.
|
||||
const type = r.headers?.get('content-type') ?? '';
|
||||
if (type && !/^\s*(text\/html|application\/xhtml\+xml|text\/plain)\b/i.test(type)) {
|
||||
discardBody(r);
|
||||
return this.cachePreview(url, fallback);
|
||||
}
|
||||
// An unread body keeps its socket reserved until the garbage collector runs,
|
||||
// which is the one thing a size cap is there to prevent.
|
||||
if (exceedsDeclaredLength(r, MAX_PREVIEW_BYTES)) { discardBody(r); return this.cachePreview(url, fallback); }
|
||||
|
||||
// A truncated head still carries the tags we scrape, so a page over the
|
||||
// budget degrades to fewer fields rather than to an error.
|
||||
const { text: html } = await readCappedText(r, MAX_PREVIEW_BYTES);
|
||||
return this.cachePreview(url, { ...scrapeOpenGraph(html), url });
|
||||
} catch {
|
||||
return fallback;
|
||||
return this.cachePreview(url, fallback);
|
||||
} finally {
|
||||
// Closed rather than left to the garbage collector: one Agent is built per
|
||||
// preview, and each keeps its sockets until something releases them.
|
||||
void (dispatcher as { close?: () => Promise<void> } | undefined)?.close?.()?.catch(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
/** A cached preview, or undefined once its entry has expired or was never there. */
|
||||
private readPreviewCache(url: string): LinkPreviewResult | undefined {
|
||||
const hit = this.previewCache.get(url);
|
||||
if (!hit) return undefined;
|
||||
if (Date.now() - hit.at > PREVIEW_CACHE_TTL_MS) {
|
||||
this.previewCache.delete(url);
|
||||
return undefined;
|
||||
}
|
||||
// Re-insert so the eviction below drops the least recently used entry.
|
||||
this.previewCache.delete(url);
|
||||
this.previewCache.set(url, hit);
|
||||
return { ...hit.result, url };
|
||||
}
|
||||
|
||||
/** Stores a preview and returns it, so call sites can `return this.cachePreview(...)`. */
|
||||
private cachePreview(url: string, result: LinkPreviewResult): LinkPreviewResult {
|
||||
if (this.previewCache.size >= PREVIEW_CACHE_MAX) {
|
||||
const oldest = this.previewCache.keys().next().value;
|
||||
if (oldest !== undefined) this.previewCache.delete(oldest);
|
||||
}
|
||||
this.previewCache.set(url, { at: Date.now(), result });
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Fire-and-forget collab notification (mirrors the legacy route's dynamic import). */
|
||||
notifyCollab(tripId: string, actor: User, preview?: string): void {
|
||||
// Injected, not a lazy import of the old notifications bridge. The laziness bought
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import dns from 'node:dns/promises';
|
||||
import { Agent } from 'undici';
|
||||
import { readEnv } from '../app-config';
|
||||
import { embeddedTransitionIpv4 } from './ipv6';
|
||||
import { embeddedTransitionIpv4, expandIpv6 } from './ipv6';
|
||||
|
||||
// Frozen at import on purpose (legacy timing; tests reload the module to change it).
|
||||
const ALLOW_INTERNAL_NETWORK = readEnv().net.allowInternalNetwork;
|
||||
@@ -13,6 +13,20 @@ export interface SsrfResult {
|
||||
error?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The IPv4 an IPv4-mapped address (`::ffff:a.b.c.d`) stands for, or null.
|
||||
*
|
||||
* Taken from the hextets rather than from the text, because `::ffff:127.0.0.1`
|
||||
* and `::ffff:7f00:1` are one address in two spellings and `dns.lookup` picks
|
||||
* which one comes back. The prefix regexes this replaces covered the dotted
|
||||
* spelling of two ranges; every other mapped address walked past them.
|
||||
*/
|
||||
function mappedIpv4(hextets: number[]): string | null {
|
||||
const g = hextets;
|
||||
if (g[0] || g[1] || g[2] || g[3] || g[4] || g[5] !== 0xffff) return null;
|
||||
return `${g[6] >> 8}.${g[6] & 0xff}.${g[7] >> 8}.${g[7] & 0xff}`;
|
||||
}
|
||||
|
||||
// Always blocked — no override possible
|
||||
function isAlwaysBlocked(ip: string): boolean {
|
||||
// Strip IPv6 brackets
|
||||
@@ -23,9 +37,21 @@ function isAlwaysBlocked(ip: string): boolean {
|
||||
// Unspecified
|
||||
if (addr.startsWith('0.')) return true;
|
||||
// Link-local / cloud metadata
|
||||
if (addr.startsWith('169.254.') || /^fe80:/i.test(addr)) return true;
|
||||
// IPv4-mapped loopback / link-local: ::ffff:127.x.x.x, ::ffff:169.254.x.x
|
||||
if (/^::ffff:127\./i.test(addr) || /^::ffff:169\.254\./i.test(addr)) return true;
|
||||
if (addr.startsWith('169.254.')) return true;
|
||||
|
||||
const hextets = expandIpv6(addr);
|
||||
if (hextets) {
|
||||
// The IPv6 unspecified address. Connecting to it lands on loopback, so it
|
||||
// reaches a local service without naming one, and it has enough spellings
|
||||
// (`::`, `::0`, `0:0:0:0:0:0:0:0`) that only the expanded hextets settle it.
|
||||
// The `0.` check above never saw any of them: they begin with a colon.
|
||||
if (hextets.every(h => h === 0)) return true;
|
||||
// fe80::/10 spans fe80: through febf:, not just the four characters 'fe80'.
|
||||
if ((hextets[0] & 0xffc0) === 0xfe80) return true;
|
||||
// A mapped address inherits the verdict of the IPv4 it carries.
|
||||
const mapped = mappedIpv4(hextets);
|
||||
if (mapped) return isAlwaysBlocked(mapped);
|
||||
}
|
||||
// IPv6 transition addresses (NAT64/6to4/Teredo) embedding a hard-blocked IPv4.
|
||||
const embedded = embeddedTransitionIpv4(addr);
|
||||
if (embedded) return isAlwaysBlocked(embedded);
|
||||
@@ -45,10 +71,12 @@ function isPrivateNetwork(ip: string): boolean {
|
||||
if (/^100\.(6[4-9]|[7-9]\d|1[01]\d|12[0-7])\./.test(addr)) return true;
|
||||
// IPv6 ULA (fc00::/7)
|
||||
if (/^f[cd]/i.test(addr)) return true;
|
||||
// IPv4-mapped RFC-1918
|
||||
if (/^::ffff:10\./i.test(addr)) return true;
|
||||
if (/^::ffff:172\.(1[6-9]|2\d|3[01])\./i.test(addr)) return true;
|
||||
if (/^::ffff:192\.168\./i.test(addr)) return true;
|
||||
// A mapped address inherits the verdict of the IPv4 it carries. Deciding on the
|
||||
// hextets rather than on three `::ffff:`-prefix regexes also covers the hex
|
||||
// spelling and the CGNAT range those regexes never listed.
|
||||
const hextets = expandIpv6(addr);
|
||||
const mapped = hextets && mappedIpv4(hextets);
|
||||
if (mapped) return isPrivateNetwork(mapped);
|
||||
// IPv6 transition addresses (NAT64/6to4/Teredo) embedding a private IPv4.
|
||||
const embedded = embeddedTransitionIpv4(addr);
|
||||
if (embedded) return isPrivateNetwork(embedded);
|
||||
|
||||
Reference in New Issue
Block a user