Why Synapse URL previews need an SSRF review before you enable them
Review Synapse URL previews as a server-side request path before you enable them. Synapse, not the user's browser, fetches the URLs that appear in messages, so each preview is an outbound request made from your homeserver's network position. If that server can reach databases, admin consoles, metadata endpoints or other private services, a crafted link can turn the homeserver into a proxy into those systems. This is server-side request forgery (SSRF), and it belongs in your security team's decision, not only in your messaging team's feature list.
The preview feature is documented in the Synapse configuration manual, which covers the preview controls, including an IP range blocklist for destinations the fetcher must not reach. Confirm in the manual for your release which preview options exist, whether the blocklist applies to every redirect hop, and which outbound request controls also cover preview fetches. Illustrative scenario: a user posts a link that redirects to an address on your private range, and the homeserver follows it from inside your network. Test that case directly rather than assuming the blocklist catches redirects. Synapse configuration manual
Make the preview decision before rollout and record who owns it. The security team should confirm the blocklist covers every private, loopback, link-local and cloud metadata range in your environment, since the blocklist only protects the ranges you list. Pair it with egress rules on the homeserver host so that a missed range still cannot reach internal services. Ask the Synapse operators to log preview fetches and to test a link to an internal test address from a user account before go-live. Preview behavior and settings can change between releases, so add the preview check to every upgrade, starting from the Synapse upgrade notes.
Which URL preview controls fit which deployment
This table compares four ways to handle link previews in Synapse, from turning them off to filtering outbound traffic at the network layer. Read each row for what the control protects, what it leaves open, and the deployment where it fits. The main takeaway is that the built-in IP range blocklist reduces risk but does not replace egress controls where internal services are reachable from the homeserver.
| Control | What it protects and what it misses | When it fits |
|---|---|---|
| Previews disabled | Protects: removes the server-side fetch of user-supplied URLs entirely, so no preview request leaves the homeserver. Misses: nothing on the preview path, but users lose link summaries and clients may still fetch previews directly. | Regulated or internal-only deployments where link previews are not needed and the team wants the smallest outbound surface. |
| Default IP range blocklist (preview on) | Protects: blocks preview requests to the private and special-purpose address ranges that Synapse's preview logic blocks by default. Misses: DNS names that resolve to internal addresses if the check does not cover the resolved result in your version, redirects you have not tested, and internal hosts on public-looking addresses. | Public or semi-public servers that want previews and have no sensitive services reachable from the homeserver network. Confirm the default behavior in the Synapse configuration manual for your release. |
| Extra blocklist entries for internal ranges | Protects: adds your own ranges, such as corporate networks, cloud metadata addresses or service subnets, to the preview blocklist through the url_preview_ip_range_blacklist setting. Misses: any host you did not list, any range that changes after the config is written, and anything reached through a permitted proxy path. | Deployments with known internal ranges that must stay unreachable. Confirm exact setting names and value formats in the configuration manual before editing. |
| Egress controls at the network layer | Protects: enforces what the homeserver host can reach, through a forward proxy or firewall rules that deny internal subnets and metadata endpoints regardless of application settings. Misses: traffic from other hosts, and destinations you allowed for legitimate reasons. Needs ongoing review of allowed destinations. | Organizations that need evidence that outbound paths are restricted, or where application-level blocklists cannot be trusted alone. Usually combined with one of the application settings above. |
Setting up previews with blocklists and egress limits
This sequence turns link previews on without letting the homeserver fetch addresses inside your network. It starts with an inventory of what must stay unreachable, sets the Synapse preview settings, adds network-level egress limits, and ends with tests showing that internal targets are refused.
Inventory internal ranges and metadata endpoints
Before changing anything, list every address range the homeserver host must never reach through a preview. Include private IPv4 and IPv6 ranges used by your data center, cloud VPC subnets, management networks, and the link-local address that cloud platforms use for instance metadata. Add internal DNS names that resolve to these addresses. The platform team owns this list, with input from the cloud and network teams. It is done when the list is written down, reviewed, and each entry names its network owner. Confirm the metadata address for your cloud provider in its documentation.
Review the preview settings in the manual
Open the Synapse configuration manual and read the entries for
url_preview_enabledandurl_preview_ip_range_blacklistfor the version you run. Confirm the default blacklist contents, how entries are matched, and whether an exception key such asurl_preview_ip_range_whitelistexists in your version, since an exception can reopen a path you intend to close. Record the exact keys and values you plan to set. It is done when your change record lists each setting with its current and intended value, and a second engineer has checked it.Enable previews with an explicit blocklist
In
homeserver.yaml, seturl_preview_enabledto true only if your users need previews, then add your inventory tourl_preview_ip_range_blacklistas CIDR ranges. Illustrative example: one entry for your data center subnet and one for the link-local metadata range. Leave any whitelist exception unset unless a specific internal service needs previews, and document the owner and reason for each exception. Keep the file in version control so every change is reviewed. It is done when the configuration passes a syntax check and the diff matches the approved change record.Add egress limits on the homeserver host
The blocklist is one layer, and network rules form the second. Add outbound rules on the host firewall, cloud security group or egress proxy so the Synapse process can reach public web ports it needs, but no private or link-local destination. Allow DNS only to resolvers you control. The network or cloud team owns these rules. It is done when a connection from the homeserver host to a test address in a private range fails at the network layer, shown by a refused or dropped connection in the firewall or proxy logs.
Restart Synapse and confirm settings load
Restart the Synapse process with your normal service manager, then check the startup log for configuration errors that would stop the server or silently drop an entry. Confirm the homeserver responds on its client API and that a test account can request a preview for an allowed public page. It is done when the log shows a clean start and the public preview succeeds. If public previews fail, check the egress rules before loosening any Synapse setting.
Test previews against internal targets
From a test account, send messages containing links to internal test targets placed on the ranges in your inventory. Examples include a small web server on a private address, a test host on the metadata range if your platform allows it, and a hostname that resolves to a private IP. Request each preview. Expect a refusal or an empty preview, and confirm in the Synapse log that the fetch was blocked. It is done when every internal target is refused and the results are recorded with timestamps.
Retest after upgrades and rule changes
Repeat the internal target tests after each Synapse upgrade, each change to the blocklist, firewall or cloud rules, and each DNS change. Reread the configuration manual for the new version, since defaults and keys can change between releases. Keep the test script and results with your change records so a security reviewer or auditor can see the control working. It is done when the retest passes and the record shows the Synapse version and settings tested.
Security risks that remain after blocklists are set
An IP range blocklist covers the addresses you thought of at configuration time. The risks below sit at the edges of that list: how names resolve, how requests redirect, how addresses are written, and what else shares the network. Each card pairs one risk with the control that addresses it and what to check on your own server.
DNS rebinding and redirects
A preview URL can resolve to a public address when the blocklist is checked and to a private address when the request is made, or it can redirect to an internal host after a first allowed response. Synapse's preview fetch must validate the address it actually connects to, not only the hostname in the link. Test by posting a link to a name you control that first resolves publicly and then to 127.0.0.1, and confirm the request is refused and logged.
Cloud metadata endpoints
On cloud hosts, the instance metadata service sits at a link-local address that often returns temporary credentials to anything on the instance. A blocklist that covers only RFC 1918 ranges can miss it. Confirm that the link-local range is in your preview blocklist, and that the homeserver's cloud role has no more permissions than the service needs. Then test a preview against the metadata address from the homeserver host.
IPv6 and alternate address encodings
Private services can be reached through IPv6 loopback, IPv4-mapped IPv6 addresses, unique local addresses, or decimal, octal and hexadecimal forms of IPv4 addresses. Each form can bypass a naive string match. Check that your blocklist covers IPv6 ranges as well as IPv4, and that the URL is parsed to a resolved address before the check. Test each encoding of a private address in a lab preview.
Neighbors on shared hosting
A server that is allowed to reach a public address may still reach other tenants, load balancers or internal services that share its subnet or hosting provider. A blocklist cannot see those peers unless their ranges are listed. Ask your hosting or cloud team which ranges the homeserver can reach, and verify from the host that unrelated internal hosts refuse connections from the homeserver.
Homeserver in a flat network
When the homeserver sits in the same network segment as databases, admin consoles and identity services, any preview that reaches an internal address reaches them too. Outbound filtering is then the only barrier. Place Synapse in its own segment, allow outbound traffic only to the proxy or public internet path you choose, and confirm from the host that database and admin ports refuse connections. This control limits damage even when a blocklist entry is missing.
Synapse configuration manualHow a preview request should flow through your network
The flow starts when a Matrix client sends a link to the homeserver, which asks for a preview of the URL. Synapse should check the requested address against its preview blocklist before any outbound connection is made, then send the request only through the controlled egress path. Public targets are fetched, while anything resolving to an internal range is refused. Check that the trust boundary around internal services holds, because a preview path that bypasses egress control is where an internal request can leak through.
Preview requests pass a blocklist and egress control before reaching any target.
Limits to confirm in your environment
URL previews make your homeserver fetch addresses that users choose, so the safety of the feature depends on facts about your own version, network path and cloud platform. The items below are the points to confirm before you trust the blocklist and outbound controls described on this page.
Synapse version and preview settings
Confirm the exact Synapse release you run and read the URL preview options in your installed configuration manual, not from memory. The url_preview_enabled key and the url_preview_ip_range_blacklist list are the controls that matter here, and their defaults or names can change between releases. Check whether your version has the blocklist you expect and whether any ranges were added or removed during your last upgrade.
Source addresses behind proxies
Confirm whether your reverse proxy, load balancer or CDN changes the source address of outbound requests or the address Synapse sees. Previews are fetched from the homeserver, so the blocklist only protects you if Synapse's own egress path is the path you think it is. Ask your network team to trace one preview request end to end and record the address the target receives.
Cloud metadata endpoints
Confirm how your cloud provider exposes instance metadata and whether that endpoint sits on a link-local or otherwise reserved address that your blocklist already covers. Metadata services are a common target of server-side request forgery because they can return temporary credentials. Ask whether the platform offers a stronger control, such as requiring session tokens for metadata, and whether it applies to every node pool that runs Synapse.
Egress proxy support
Confirm whether the Synapse version you run can send preview requests through an outbound proxy, and whether that proxy can enforce its own destination rules. If your organization already routes outbound web traffic through a proxy, decide whether previews should use it. Test that the proxy does not reintroduce the internal paths the blocklist was meant to close.
Defaults changed by upgrades
Confirm how each upgrade changes preview defaults and whether your configuration overrides them. A key you set explicitly keeps its value, but a list you never set may gain or lose entries when the software changes. Read the upgrade notes for every release between your current version and the target, and diff your effective preview settings after each upgrade in a staging environment.
Synapse upgrade notesQuestions teams ask before enabling URL previews
Can we enable URL previews safely without outside help?
Yes, an experienced platform team can make link previews safe in-house, but the result depends on checking network paths that teams often overlook. Synapse fetches the URLs that users post, so the key question is whether that outbound request can reach internal addresses, cloud metadata endpoints or private services. Your team needs to confirm that the preview blocklist covers every private, loopback and link-local range you run, that DNS resolution and redirects cannot bypass it, and that the homeserver's egress rules match the blocklist. Many organizations bring in an outside team only for the verification step, where a fixed-scope test gives an independent view of the same setup. DeployOpen runs application and infrastructure security testing and delivers findings with fixes and a retest, so the decision comes down to your team's testing experience and how much independent evidence you need.
What drives the effort of enabling URL previews on Synapse?
The effort is driven mainly by how many routes the homeserver has to the internet and to your internal networks. Each of these adds work:
What does enabling URL previews need from our team?
The work needs three things from your side: network access, Synapse administrative access and time from a security tester. Network access means the people who own your firewalls, proxies, DNS and cloud security groups must share the current egress design and allow test traffic to probe internal targets from the homeserver's network position. Synapse administrative access means someone who can change the homeserver configuration, restart the process and read its logs, so changes can be made and traced. Security testing means someone must attempt server-side request forgery against the live preview path and check what the homeserver can reach. Your team should also name an approver for configuration changes, because preview settings affect every user who posts links. The Synapse configuration manual is the reference your administrators will use to confirm the exact setting names in your version.
How long does enabling URL previews take in our environment?
No fixed duration applies because it depends on your environment, and no reliable figure exists until someone maps the network. The main variables are the number of egress paths, how many internal ranges must be covered, how many layers of proxy and DNS sit between the homeserver and the internet, and how long your change approval and security review cycles take. Compliance review adds time when auditors or internal risk teams want written evidence of each control before a change goes live. Testing time grows when the first round finds gaps and a retest is needed. For a planned estimate, ask for the scope written out as network diagrams, a list of egress paths, the change approval steps and the number of test rounds in the proposal. A fixed-scope agreement sets the deliverables and timeline in writing before work starts, so you can compare options on the same basis.
Should we repeat URL preview testing after Synapse upgrades?
Yes, repeat the test after upgrades that touch the preview code, the HTTP client, dependencies, or the configuration defaults that control previews. Upgrades can change how requests are made, which headers and redirects are followed, and which settings exist or default to a value you did not choose. Network changes also matter, so a retest should follow any change to firewall rules, proxies, DNS or cloud network layout, even when Synapse itself is unchanged. Read the upgrade notes for every release between your current version and the target before you upgrade, because the notes flag configuration changes and platform floors. Keep a short regression test in your release checklist so that the same blocked ranges and egress rules are checked each time. Retainers can cover recurring retests if your team prefers outside testing on a fixed cycle.
Does a blocklist alone stop server-side request forgery from link previews?
No, a blocklist is one control and it does not stop server-side request forgery by itself. Attackers can use hostnames that resolve to internal addresses, redirects that move a safe-looking URL to a private target, and DNS responses that change between the check and the fetch. The safer design layers controls: a preview blocklist covering every private and special-purpose range you operate, egress firewall rules on the homeserver's network that deny internal destinations, and proxy controls that the homeserver must use for outbound requests. Your team should also verify that the homeserver cannot reach the admin API, replication listener or metrics endpoints from the preview path. Test each layer separately, because a passing blocklist test can hide a permissive egress rule.
Which compliance reviews involve link preview controls?
Link previews matter to any compliance review that examines outbound network paths, access to internal systems, or logging of server-side activity, which often includes regulated financial, healthcare and public sector environments. Reviewers usually want to see the written control design, the configuration as deployed, the egress rules that enforce it, evidence that the controls were tested, and records of changes after upgrades. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports, attestations or certifications, and independent auditors and certification bodies make that determination. Ask your compliance lead which control frameworks apply and which evidence format the assessor expects before testing begins, so the evidence collected during the work matches what the review requires.
What does URL preview hardening cost, and what recurs afterward?
Cost comes from who does the work and how much of it is one-time versus recurring. One-time costs include network mapping, configuration changes, egress rule changes, the initial security test and any remediation of findings. Recurring costs include retesting after upgrades and network changes, monitoring of preview logs, and the staff time to review configuration changes. Costs rise with the number of egress paths, the size of the network, the number of compliance reviews and the number of test rounds needed. In-house work shifts cost to salaried staff time and their availability for other projects. For an outside engagement, DeployOpen does not publish a price list. Ask for a quote that lists each deliverable, the test rounds included, the retest terms, what the client must provide, and which items recur under a retainer.
How to verify previews cannot reach internal networks
The only reliable proof that URL previews cannot reach internal networks is a repeatable test that tries to reach them and records what happens. Use a dedicated test account on a staging homeserver that mirrors production preview settings, then send messages containing links to loopback (127.0.0.1 and ::1), each private range the blocklist is meant to cover, link-local addresses, and the cloud metadata address your provider uses. Point the links at a listener you control on an internal test host where possible, so a successful fetch leaves a visible trace in its access log. Record the link, the time, the Synapse log line for the preview request, the HTTP result shown to the client, and whether the internal listener saw a connection. Confirm the exact address ranges in your configuration against the Synapse configuration manual before writing the test cases, because the list you test must match the list you deploy.
Run the same suite again after every Synapse upgrade, after any change to url_preview_ip_range_blacklist, url_preview_ip_range_whitelist or the outbound proxy and DNS settings, and after changes to the firewall or egress rules around the homeserver. Upgrades matter here because preview code, default settings and dependencies can change between releases, and the Synapse upgrade notes should be read for each version you move through. Include DNS rebinding and redirect cases in the suite, where a public hostname resolves to a private address or redirects to one, since a name-based check alone does not stop them. Ask your Synapse operator or vendor to confirm how redirects and DNS resolution are handled in your version, because that behavior determines which tests are meaningful.
A security or compliance reviewer will usually want the test plan with its version and date, the list of addresses and ranges tested, the raw results for each case, and the configuration file and firewall rules in force when the tests ran. They will also ask who ran the tests, how failures were tracked to closure, and whether the retest after each upgrade produced the same results. Keep the evidence in the same change record as the upgrade, so a reviewer can connect a configuration to a test run. DeployOpen can test and document this path as part of a security review, but an independent auditor decides whether the evidence meets a specific control requirement.
Official Synapse sources to read before changing preview settings
Where do I confirm the exact URL preview settings for my Synapse version?
The Synapse configuration manual is the authoritative list of options that control link previews, so confirm key names and defaults there before you edit anything. Find the section on URL previews and note which options control the IP range blocklist, the preview toggle, and any limits on how previews are fetched. Compare the manual against the release you actually run, not an older config file or a forum post, because option names and defaults can change between releases. Record the key names you plan to change in your change ticket so the reviewer can check them against the same page.
What should I check in the Synapse upgrade notes before changing preview settings?
Read the upgrade notes for every release between your current version and your target, because a preview setting that works today may change in a later release. Check the platform floors: Synapse 1.143.0 and later require PostgreSQL 14 or newer, and 1.142.0 and later require Python 3.10 or newer. Also look for database schema changes, since the notes warn that rolling back can be difficult. If a release changes how it handles configuration or background database updates, plan that step before you touch the preview options so you can tell which change caused any problem.
Can I roll back a Synapse upgrade if a preview change breaks something?
Not always easily. The upgrade notes warn that rollback can be difficult because database schema changes between releases may not reverse cleanly. For that reason, keep preview configuration changes separate from version upgrades where you can, so a failure points to one cause. Take a database backup before the change, confirm your restore steps on a staging copy, and keep the previous configuration file. Ask your team to confirm the restore procedure in its own environment, since backup tooling and storage differ from one deployment to another.
Which Synapse versions require PostgreSQL 14 or Python 3.10?
Synapse 1.143.0 and later require PostgreSQL 14 or newer, and 1.142.0 and later require Python 3.10 or newer, according to the upgrade notes. Check both floors before you schedule a preview change alongside an upgrade. The notes also say Synapse drops support for Python and PostgreSQL versions once they reach upstream end of life, so an older operating system package can block the upgrade you need. Confirm the installed versions on each host, including worker hosts if you run workers, and plan any platform upgrade as its own change with its own test window.
How do I pick the Synapse release to target when I update preview settings?
Start from the Synapse releases page on GitHub, which lists v1.163.0 published October 14, 2026, at the time of research. The newest release is not automatically the right target. Choose a release that fits your support window and your platform versions, then read the upgrade notes for every version between your current release and that target. If you change preview settings, do it on a release you have tested in staging, and confirm the release date and status on the page on the day you plan the change.
Which Synapse worker documentation matters if my preview requests run on a worker?
Read the Synapse workers documentation to see which worker types handle client, federation and event traffic in your layout, and then confirm which process fetches link previews in your deployment. If a worker makes the outbound request, the blocklist and any network restrictions must apply on that host too, not only on the main process. Check how each worker reaches Redis and the internal network, and test previews from the same path your users take. Write the result into your test plan before you change the configuration.
Is it safe to copy a URL preview configuration from a blog post or forum?
Treat any copied configuration as a draft, not a finished setting. Examples online may come from older releases, may use keys that were renamed, or may leave out the outbound controls your network needs. Compare every key against the configuration manual for your exact release, then test the result. A practical test is to post links to internal hostnames and private addresses from a test account on a staging server and confirm that previews are refused. Repeat the test after each upgrade, since a later release can change how the settings behave.
What should I ask a partner to confirm before changing these settings?
Ask which release and configuration keys will change, which upgrade notes were reviewed, and how each change will be tested on staging before production. Request the backup and restore steps in writing, along with the internal-address test cases that prove previews are refused. Most DeployOpen engagements are fixed-scope, so scope, deliverables and timelines are agreed in writing before work starts. DeployOpen does not publish a price list, and a quote follows from that written scope, so describe your Synapse version, hosting layout and worker setup clearly when you ask for one.
How DeployOpen scopes and tests Synapse preview controls
DeployOpen plans preview work as a fixed-scope engagement agreed in writing before any change is made. The cards below follow that path from scoping through configuration, security testing and retest, and they cover the items an approver will want to see before accepting a plan.
Written scope before any change
The engagement starts with an agreed document that names the Synapse version, the network segments the preview fetcher can reach, the preview settings in scope and the evidence you will receive. Ask for the list of internal ranges that must be blocked and who in your organization confirms it. Because the scope is fixed in writing, you can compare it directly with an internal estimate or another partner's proposal.
Synapse and network configuration
DeployOpen configures the URL preview IP range blocklist in Synapse together with the outbound controls around the homeserver, such as egress firewall rules and proxy settings where your architecture uses them. Changes are made inside your cloud accounts, data centers or isolated networks. Ask who owns the firewall change, who reviews it and how it is rolled back if a preview breaks.
Synapse configuration manualSSRF testing of the preview path
Testing targets the preview fetcher the way an attacker would: submitting links that resolve to loopback, private, link-local and metadata addresses, following redirects into internal hosts, and checking whether responses leak into the room. Results show which addresses were reachable before and after the change. Ask whether the test uses your real internal ranges or a lab replica, because that choice changes what the result proves.
Findings, fixes and retest
Each finding comes with severity, reproduction steps, the configuration change that fixes it and a retest against the same test cases after the fix is applied. Findings that need a network team decision are marked as such, so your team knows what to route. Ask for the retest evidence in the delivered report, not only a statement that the fix was applied.
Retainers for upgrade retesting
Synapse releases change the preview code and its defaults, so a control that passed once may need checking again after an upgrade. DeployOpen offers ongoing retainers that cover re-running the preview tests when you upgrade. Before you sign, confirm which Synapse versions the retainer covers, how upgrades are scheduled with your change board and what happens if a retest fails.

