security(gen1): allow only Firestorm and OpenGenesisLINK viewers at all admission points (#331)

* security(gen1): define unified Firestorm and OpenGenesisLINK viewer admission policy

* build(gen1): include shared viewer admission policy in OpenSim.Framework

* security(gen1): enforce approved-viewer admission in OpenSim/Services/LLLoginService/LLLoginService.cs

* security(gen1): enforce approved-viewer admission in OpenSim/Services/HypergridService/GatekeeperService.cs

* security(gen1): enforce approved-viewer admission in OpenSim/Region/Framework/Scenes/Scene.cs

* config(gen1): enable Firestorm and OpenGenesisLINK viewer-only admission

* config(gen1): enable Firestorm and OpenGenesisLINK viewer-only admission

* config(gen1): enable Firestorm and OpenGenesisLINK viewer-only admission

* config(gen1): enable Firestorm and OpenGenesisLINK viewer-only admission

* config(gen1): enable Firestorm and OpenGenesisLINK viewer-only admission

* config(gen1): enable Firestorm and OpenGenesisLINK viewer-only admission

* test(gen1): approved Firestorm/OpenGenesisLINK viewer admission regression

* test(gen1): approved Firestorm/OpenGenesisLINK viewer admission regression

* test(gen1): approved Firestorm/OpenGenesisLINK viewer admission regression

* ci(gen1): run viewer whitelist regression and all admission-path guards

* docs(gen1): document official viewer-only policy and spoofing limitations

* test(gen1): accept regenerated Prebuild compile-entry form in viewer guard
This commit is contained in:
OpenGenesis (MPL 2.0) authored and GitHub committed 2026-10-28 14:28:37 +01:00
1 parent 46b45135b4
commit 4b32646bf2
16 files changed
+353

No files matched your search

+7
View File
@@ -827,6 +827,13 @@ jobs:
shell: bash
run: python3 tools/ci/verify_gen1_hg_asset_egress_lockdown.py
- name: Verify Generation 1 approved-viewer admission policy
shell: bash
run: |
set -euo pipefail
python3 tools/ci/verify_gen1_approved_viewer_access.py
dotnet run --project tools/ci/OglApprovedViewerRegression/OglApprovedViewerRegression.csproj --configuration Release
- name: Runtime smoke test LLLogin protocol
shell: bash
run: bash tools/ci/smoke_lllogin_protocol.sh
@@ -0,0 +1,88 @@
// SPDX-License-Identifier: MPL-2.0
using System;
namespace OpenSim.Framework
{
/// <summary>
/// Generation 1 admission policy for self-reported viewer names.
/// This is a compatibility allowlist, NOT verified client attestation:
/// a modified viewer can forge both the channel and version strings.
/// </summary>
public static class OglApprovedViewerPolicy
{
private static readonly string[] s_AllowedNames =
{
"Firestorm", "OpenGenesisLINK", "OGL Viewer"
};
private static readonly string[] s_KnownCopybotNames =
{
"Darkstorm", "Hydrastorm", "Copybot"
};
public static bool IsAllowed(string viewer, string channel)
{
if (ContainsKnownCopybotName(viewer) || ContainsKnownCopybotName(channel))
return false;
if (StartsWithApprovedName(viewer))
return string.IsNullOrWhiteSpace(channel) ||
StartsWithApprovedName(channel) ||
IsNumericVersion(channel);
return StartsWithApprovedName(channel) && IsNumericVersion(viewer);
}
private static bool ContainsKnownCopybotName(string value)
{
if (string.IsNullOrWhiteSpace(value))
return false;
foreach (string name in s_KnownCopybotNames)
{
if (value.Contains(name, StringComparison.OrdinalIgnoreCase))
return true;
}
return false;
}
private static bool StartsWithApprovedName(string value)
{
if (string.IsNullOrWhiteSpace(value))
return false;
string normalized = value.Trim();
foreach (string name in s_AllowedNames)
{
if (!normalized.StartsWith(name, StringComparison.OrdinalIgnoreCase))
continue;
if (normalized.Length == name.Length)
return true;
char next = normalized[name.Length];
if (char.IsWhiteSpace(next) || next == '-' || next == '_')
return true;
}
return false;
}
private static bool IsNumericVersion(string value)
{
if (string.IsNullOrWhiteSpace(value))
return true;
string normalized = value.Trim();
if (!char.IsDigit(normalized[0]))
return false;
foreach (char c in normalized)
{
if (!char.IsDigit(c) && c != '.' && c != '-' &&
c != '_' && c != '(' && c != ')' && !char.IsWhiteSpace(c))
return false;
}
return true;
}
}
}
@@ -252,6 +252,7 @@
<Compile Include="SLUtil.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="OglApprovedViewerPolicy.cs" />
<Compile Include="AssetPermissions.cs">
<SubType>Code</SubType>
</Compile>
+14
View File
@@ -275,6 +275,7 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_minRegionViewDistance; }
}
private bool m_OglApprovedViewersOnly;
private readonly List<string> m_AllowedViewers = new();
private readonly List<string> m_BannedViewers = new();
@@ -1076,6 +1077,8 @@ namespace OpenSim.Region.Framework.Scenes
}
string[] possibleAccessControlConfigSections = new string[] { "Startup", "AccessControl"};
m_OglApprovedViewersOnly = Util.GetConfigVarFromSections<bool>(config,
"OGLApprovedViewersOnly", possibleAccessControlConfigSections, false);
string grant = Util.GetConfigVarFromSections<string>(
config, "AllowedClients", possibleAccessControlConfigSections, string.Empty);
@@ -4046,6 +4049,17 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
// Enforce again at region entry, including direct travel and crossings.
// Viewer strings can be forged; this is not cryptographic attestation.
if (m_OglApprovedViewersOnly &&
!OglApprovedViewerPolicy.IsAllowed(acd.Viewer, acd.Channel))
{
reason = "Only Firestorm or OpenGenesisLINK Viewer is permitted";
m_log.InfoFormat("[OGL VIEWER ACCESS]: Region {0} rejected viewer {1}, channel {2}",
RegionInfo.RegionName, acd.Viewer, acd.Channel);
return false;
}
//Check if the viewer is banned or in the viewer access list
//We check if the substring is listed for higher flexebility
bool ViewerDenied = true;
@@ -58,6 +58,7 @@ namespace OpenSim.Services.HypergridService
private static IGridUserService m_GridUserService;
private static IBansService m_BansService;
private static bool m_OglApprovedViewersOnly;
private static Regex m_AllowedClientsRegex = null;
private static Regex m_DeniedClientsRegex = null;
private static string m_DeniedMacs = string.Empty;
@@ -151,6 +152,8 @@ namespace OpenSim.Services.HypergridService
m_SimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args);
string[] possibleAccessControlConfigSections = new string[] { "AccessControl", "GatekeeperService" };
m_OglApprovedViewersOnly = Util.GetConfigVarFromSections<bool>(config,
"OGLApprovedViewersOnly", possibleAccessControlConfigSections, false);
string AllowedClients = Util.GetConfigVarFromSections<string>(config, "AllowedClients", possibleAccessControlConfigSections, string.Empty);
if (!string.IsNullOrEmpty(AllowedClients))
{
@@ -331,6 +334,16 @@ namespace OpenSim.Services.HypergridService
string curViewer = Util.GetViewerName(aCircuit);
string curMac = aCircuit.Mac.ToString();
// Reject before foreign presence registration, avatar placement or HG asset activity.
if (m_OglApprovedViewersOnly &&
!OglApprovedViewerPolicy.IsAllowed(aCircuit.Viewer, aCircuit.Channel))
{
reason = "Only Firestorm or OpenGenesisLINK Viewer is permitted";
m_log.InfoFormat("[OGL VIEWER ACCESS]: Rejected Hypergrid arrival using viewer {0}, channel {1}",
aCircuit.Viewer, aCircuit.Channel);
return false;
}
//
// Check client
@@ -86,6 +86,7 @@ namespace OpenSim.Services.LLLoginService
protected int m_MaxAgentGroups = 42;
protected string m_DestinationGuide;
protected string m_AvatarPicker;
protected bool m_OglApprovedViewersOnly;
protected Regex m_AllowedClientsRegex;
protected Regex m_DeniedClientsRegex;
protected string m_DeniedMacs;
@@ -158,6 +159,8 @@ namespace OpenSim.Services.LLLoginService
m_allowLoginFallbackToAnyRegion = m_LoginServerConfig.GetBoolean("AllowLoginFallbackToAnyRegion", m_allowLoginFallbackToAnyRegion);
string[] accessControlConfigSections = new string[] { "AccessControl", "LoginService" };
m_OglApprovedViewersOnly = Util.GetConfigVarFromSections<bool>(config,
"OGLApprovedViewersOnly", accessControlConfigSections, false);
string AllowedClients = Util.GetConfigVarFromSections<string>(config, "AllowedClients", accessControlConfigSections, string.Empty);
if (!string.IsNullOrEmpty(AllowedClients))
{
@@ -401,6 +404,16 @@ namespace OpenSim.Services.LLLoginService
try
{
// The server refuses nonapproved self-reported viewers before
// authentication, account/presence creation or asset traffic.
if (m_OglApprovedViewersOnly &&
!OglApprovedViewerPolicy.IsAllowed(clientVersion, channel))
{
m_log.InfoFormat("[OGL VIEWER ACCESS]: Rejected local login: viewer {0}, channel {1}",
clientVersion, channel);
return LLFailedLoginResponse.LoginBlockedProblem;
}
//
// Check client
//
+6
View File
@@ -80,6 +80,12 @@
CertHostIp = "127.0.0.1"
[AccessControl]
; Generation 1 viewer admission: local login, Hypergrid arrival and region entry.
; Approved product families: Firestorm, OpenGenesisLINK (including OGL Viewer).
; Unknown, Darkstorm, Hydrastorm and other nonapproved viewer names are refused.
; WARNING: viewer-reported channel/version can be spoofed. Not DRM or proof of identity.
OGLApprovedViewersOnly = true
[Map]
GenerateMaptiles = true
+6
View File
@@ -79,6 +79,12 @@
CertHostIp = "127.0.0.1"
[AccessControl]
; Generation 1 viewer admission: local login, Hypergrid arrival and region entry.
; Approved product families: Firestorm, OpenGenesisLINK (including OGL Viewer).
; Unknown, Darkstorm, Hydrastorm and other nonapproved viewer names are refused.
; WARNING: viewer-reported channel/version can be spoofed. Not DRM or proof of identity.
OGLApprovedViewersOnly = true
[Map]
GenerateMaptiles = true
+6
View File
@@ -267,6 +267,12 @@
; GatekeeperURIAlias = "login.osgrid.org"
[AccessControl]
; Generation 1 viewer admission: local login, Hypergrid arrival and region entry.
; Approved product families: Firestorm, OpenGenesisLINK (including OGL Viewer).
; Unknown, Darkstorm, Hydrastorm and other nonapproved viewer names are refused.
; WARNING: viewer-reported channel/version can be spoofed. Not DRM or proof of identity.
OGLApprovedViewersOnly = true
;# {AllowedClients} {} {Bar (|) separated list of allowed clients} {}
;; Bar (|) separated list of viewers which may gain access to the regions.
;; One can use a substring of the viewer name to enable only certain
+6
View File
@@ -247,6 +247,12 @@
; GatekeeperURIAlias = "login.osgrid.org"
[AccessControl]
; Generation 1 viewer admission: local login, Hypergrid arrival and region entry.
; Approved product families: Firestorm, OpenGenesisLINK (including OGL Viewer).
; Unknown, Darkstorm, Hydrastorm and other nonapproved viewer names are refused.
; WARNING: viewer-reported channel/version can be spoofed. Not DRM or proof of identity.
OGLApprovedViewersOnly = true
;# {AllowedClients} {} {Bar (|) separated list of allowed clients} {}
;; Bar (|) separated list of viewers which may gain access to the regions.
;; One can use a substring of the viewer name to enable only certain
+6
View File
@@ -245,6 +245,12 @@
; GatekeeperURIAlias = "login.osgrid.org"
[AccessControl]
; Generation 1 viewer admission: local login, Hypergrid arrival and region entry.
; Approved product families: Firestorm, OpenGenesisLINK (including OGL Viewer).
; Unknown, Darkstorm, Hydrastorm and other nonapproved viewer names are refused.
; WARNING: viewer-reported channel/version can be spoofed. Not DRM or proof of identity.
OGLApprovedViewersOnly = true
;# {AllowedClients} {} {Bar (|) separated list of allowed clients} {}
;; Bar (|) separated list of viewers which may gain access to the regions.
;; One can use a substring of the viewer name to enable only certain
+6
View File
@@ -186,6 +186,12 @@
;ConsolePort = 0
[AccessControl]
; Generation 1 viewer admission: local login, Hypergrid arrival and region entry.
; Approved product families: Firestorm, OpenGenesisLINK (including OGL Viewer).
; Unknown, Darkstorm, Hydrastorm and other nonapproved viewer names are refused.
; WARNING: viewer-reported channel/version can be spoofed. Not DRM or proof of identity.
OGLApprovedViewersOnly = true
;# {AllowedClients} {} {Bar (|) separated list of allowed clients} {}
;; Bar (|) separated list of viewers which may gain access to the regions.
;; One can use a substring of the viewer name to enable only certain
+60
View File
@@ -0,0 +1,60 @@
# OpenGenesisLINK Generation 1 – Offizielle Viewer-Zulassung
**Status:** Entwicklung (technischer Build 0.9.4.0 Dev), nach PR-Merge noch kein automatischer Live-Rollout.
## Zugelassene Viewer
- **Firestorm Viewer** – `Firestorm` und Firestorm-Channel wie `Firestorm-Releasex64`
- **OpenGenesisLINK Viewer** – `OpenGenesisLINK` und der projektinterne Name `OGL Viewer`
Andere selbst gemeldete Viewernamen – einschließlich **Darkstorm**, **Hydrastorm**, Alchemy, Singularity, Cool VL und unbekannter Clients – sind nicht zugelassen.
Der Zugang ist an **drei Stellen** serverseitig geprüft:
1. lokaler ROBUST LoginService vor erfolgreicher Anmeldung;
2. ROBUST GatekeeperService vor Hypergrid-Präsenz und Weitergabe an Zielregion;
3. Simulator Scene beim Eintritt, Direkttransport und Region Crossing.
Dafür nutzt Generation 1 die gemeinsame Implementierung `OpenSim.Framework.OglApprovedViewerPolicy`. Sie erfordert einen passenden offiziellen Namen am Anfang des Viewer-Kanals oder der Viewer-Version, prüft widersprüchliche Namensangaben und verwirft ausdrücklich die bekannten Copybot-Kennungen, selbst wenn ein erlaubter Name zusätzlich vorkommt. Numerische Versionsstrings mit offiziell angegebenem Viewer-Channel werden akzeptiert; komplett fehlende/unbekannte Kennungen nicht.
## Konfiguration
Aktive Profile und Vorlagen:
```ini
[AccessControl]
OGLApprovedViewersOnly = true
```
Das gilt sowohl für ROBUST (LoginService **und** GatekeeperService) als auch für jeden Simulator (`OpenSim.ini`). Nach einem Update müssen tatsächlich geladene Konfigurationen auf allen Nodes geprüft und die betroffenen Dienste neu gestartet werden. Für Tests kann die Option in einer isolierten Umgebung auf `false` gesetzt werden.
Bisherige `AllowedClients`/`DeniedClients`-Regeln werden weiterhin angewandt; diese dürfen die zwei offiziellen Viewer nicht zusätzlich ungewollt ausschließen. Die bestehende OGL Viewer Advisor-Empfehlung ist unabhängig davon und bleibt deaktiviert.
## Hypergrid und Marketplace bleiben offen
```ini
[HGInventoryAccessModule]
OutboundPermission = true
[HGAssetService]
DisallowAllExport = false
```
Berechtigte ausländische Gäste mit Firestorm/OpenGenesisLINK können Gegenstände kaufen, in ihr eigenes Inventar übertragen, heimreisen und sie im Rahmen der üblichen Objektberechtigungen aufstellen. Die HG-Asset-Endpunkte bleiben für autorisierte Transaktionen offen. Die Begrenzung großer Asset-Existenzabfragen aus PR #330 bleibt erhalten.
## Sicherheitsgrenze (verpflichtend klar kommunizieren)
**Viewer-Kennung ist keine vertrauenswürdige Identität.** Viewer senden Channel und Version selbst; ein modifizierter Darkstorm/Hydrastorm-Client kann sich als Firestorm tarnen. Diese Allowlist sperrt nur nicht freigegebene **gemeldete** Viewer und ihre Sitzungen. Sie stellt keine kryptografische Viewer-Attestierung dar und kann clientseitiges Exportieren empfangener Meshes/Texturen nicht zu 100 % verhindern.
Ebenso ist ein öffentlicher Hypergrid-Asset-HTTP-Endpunkt nicht automatisch einer Viewer-Sitzung zugeordnet: Direkte HTTP-Aufrufe auf Import/Export-Assetrouten können **nicht allein über die Login-Zulassung** abgesichert werden. Eine vollständige Sitzungs-/Asset-Berechtigung benötigt ein zusätzliches protokollkompatibles Authentisierungsdesign, das HG-Handel nicht unterbricht.
## Tests vor Produktivbetrieb
- Anmelden lokal: Firestorm und OpenGenesisLINK (auch interne Aliaskennung) erfolgreich.
- Ablehnen lokal: Darkstorm, Hydrastorm, nicht freigegebene/fehlende Kennungen und bekannte Spoof-Kombinationen.
- Gatekeeper: Firestorm-Gast darf hinein, Darkstorm/Hydrastorm sowie unbekannte Gäste werden vor Präsenzanlage abgelehnt.
- Regionen: Zugelassene lokale/HG-Avatare können teleportieren und Regionen wechseln; sonstige werden abgewiesen.
- Erhalt der Kaufkette: HG-Gast kauft Mesh/Kleidung, nimmt sie heim und kann sie dort rezzen/tragen. Reguläre Imports bleiben möglich.
- Live- und Negativtests auf Staging vor Produktion, inklusive Netztopologie und Konfigurationsvererbung.
- Keine pauschale HG-Exportsperre, kein verfrühter Stable-Rollout.
**Verifikation:** `tools/ci/verify_gen1_approved_viewer_access.py` und `tools/ci/OglApprovedViewerRegression`, zusätzlich zur normalen NexVerse CI.
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Include="../../../OpenSim/Framework/OglApprovedViewerPolicy.cs" Link="OglApprovedViewerPolicy.cs" />
</ItemGroup>
</Project>
@@ -0,0 +1,51 @@
using System;
using OpenSim.Framework;
internal static class Program
{
private static int m_Count;
private static void Check(string viewer, string channel, bool expected)
{
bool actual = OglApprovedViewerPolicy.IsAllowed(viewer, channel);
if (actual != expected)
throw new Exception("Viewer admission regression: viewer='" + viewer +
"', channel='" + channel + "', expected=" + expected +
", actual=" + actual);
m_Count++;
}
public static void Main()
{
// Firestorm version/channel reporting used by local and HG login.
Check("Firestorm-Release 7.1.0", "Firestorm-Releasex64", true);
Check("7.1.0.12345", "Firestorm-Releasex64", true);
Check("Firestorm-Release HG CI", "Firestorm-Releasex64", true);
Check("Firestorm", "", true);
Check("OpenGenesisLINK Viewer 1.0", "OpenGenesisLINK-Release", true);
Check("1.0.0.1", "OpenGenesisLINK", true);
Check("OGL Viewer 1.0", "OGL Viewer", true);
Check("1.0.0", "OGL Viewer-Release", true);
Check("OpenGenesisLINK-Release", null, true);
// Denials: explicit known Copybot labels and every other viewer family.
Check("Darkstorm 2.0", "Darkstorm", false);
Check("Hydrastorm 1.0", "Hydrastorm", false);
Check("DarkStorm-Release", "Firestorm-Releasex64", false);
Check("7.1.0", "Hydrastorm", false);
Check("Firestorm-Release Darkstorm", "Firestorm-Releasex64", false);
Check("Firestorm-copybot", "Firestorm-Releasex64", false);
Check("FirestormFake", "", false);
Check("Hydrastorm", "Firestorm-Releasex64", false);
Check("Cool VL Viewer 1.0", "Cool VL Viewer", false);
Check("Singularity 1.0", "Singularity", false);
Check("Alchemy 1.0", "Alchemy", false);
Check("Unknown", "Unknown", false);
Check("", "", false);
Check(null, null, false);
Check("Firestorm-Release", "OtherViewer", false);
Check("NotFirestorm 7", "NotFirestorm", false);
Console.WriteLine("OGL approved viewer admission: " + m_Count + " regression cases passed");
}
}
@@ -0,0 +1,59 @@
#!/usr/bin/env python3
"""Static integration guard: Generation 1 Firestorm/OGL-only admission."""
from pathlib import Path
root = Path(__file__).resolve().parents[2]
def read(name):
return (root / name).read_text(encoding="utf-8-sig")
def section(data, name):
assert data.count("[" + name + "]") == 1, name
return data.split("[" + name + "]", 1)[1].split("\n[", 1)[0]
policy = read("OpenSim/Framework/OglApprovedViewerPolicy.cs")
for marker in (
'"Firestorm", "OpenGenesisLINK", "OGL Viewer"',
'"Darkstorm", "Hydrastorm", "Copybot"',
"StartsWithApprovedName",
"ContainsKnownCopybotName",
"IsNumericVersion",
):
assert marker in policy, marker
project = read("OpenSim/Framework/OpenSim.Framework.csproj")
assert 'Compile Include="OglApprovedViewerPolicy.cs"' in project
for path, needle in (
("OpenSim/Services/LLLoginService/LLLoginService.cs",
"OglApprovedViewerPolicy.IsAllowed(clientVersion, channel)"),
("OpenSim/Services/HypergridService/GatekeeperService.cs",
"OglApprovedViewerPolicy.IsAllowed(aCircuit.Viewer, aCircuit.Channel)"),
("OpenSim/Region/Framework/Scenes/Scene.cs",
"OglApprovedViewerPolicy.IsAllowed(acd.Viewer, acd.Channel)"),
):
src = read(path)
assert needle in src, path
assert '"OGLApprovedViewersOnly"' in src, path
for path in (
"bin/Robust.HG.ini",
"bin/Robust.HG.ini.example",
"bin/Robust.HG.OGLAsset.ini.example",
"bin/Robust.ini.example",
"bin/OpenSim.ini",
"bin/OpenSim.ini.example",
):
body = section(read(path), "AccessControl")
assert "OGLApprovedViewersOnly = true" in body, path
hg = read("bin/config-include/GridCommon.ini")
robust = read("bin/Robust.HG.ini")
assert "OutboundPermission = true" in hg
assert "DisallowAllExport = false" in robust
assert "MaxHGAssetExistIds = 16384" in robust
print("Generation 1 approved-viewer access: login + gatekeeper + region + configs OK")