diff --git a/NexVerse/Server/Api/NexOfflineImMailRelay.cs b/NexVerse/Server/Api/NexOfflineImMailRelay.cs index 61a4754c..3c5029eb 100644 --- a/NexVerse/Server/Api/NexOfflineImMailRelay.cs +++ b/NexVerse/Server/Api/NexOfflineImMailRelay.cs @@ -188,37 +188,38 @@ namespace NexVerse.Server.Api } string senderEmail = OfflineImMailRelayToken.NormalizeEmail(sender.Address); - UserAccount replyingAccount = m_UserAccounts.GetUserAccount(UUID.Zero, senderEmail); - - if (replyingAccount == null || - !replyingAccount.LocalToGrid || - !replyingAccount.Active || - replyingAccount.PrincipalID.IsZero()) - { - m_Log.InfoFormat( - "[NEX-IM-MAIL-RELAY]: Ignored catch-all mail from non-NexVerse sender: {0}.", - senderEmail); - return RelayDisposition.Consumed; - } - if (!TryFindReplyLocalPart(message, out string replyLocalPart)) { m_Log.Warn("[NEX-IM-MAIL-RELAY]: Rejected catch-all mail without a NexVerse reply token."); return RelayDisposition.Consumed; } - if (!OfflineImMailRelayToken.TryValidate( + // A mailbox can belong to several avatars. The signed token must + // name the avatar that received this particular offline message. + // Never choose the first user account matching the From address. + if (!OfflineImMailRelayToken.TryValidateReply( replyLocalPart, senderEmail, m_SigningKey, DateTimeOffset.UtcNow, m_MaximumTokenLifetime, out UUID targetAgentId, - out _)) + out UUID replyingAgentId)) { - m_Log.WarnFormat( - "[NEX-IM-MAIL-RELAY]: Rejected invalid or expired reply token from account {0}.", - replyingAccount.PrincipalID); + m_Log.Warn("[NEX-IM-MAIL-RELAY]: Rejected invalid, legacy or expired identity-bound reply token."); + return RelayDisposition.Consumed; + } + + UserAccount replyingAccount = m_UserAccounts.GetUserAccount(UUID.Zero, replyingAgentId); + if (replyingAccount == null || + !replyingAccount.LocalToGrid || + !replyingAccount.Active || + replyingAccount.PrincipalID.IsZero() || + !string.Equals( + OfflineImMailRelayToken.NormalizeEmail(replyingAccount.Email), + senderEmail, StringComparison.Ordinal)) + { + m_Log.Info("[NEX-IM-MAIL-RELAY]: Rejected reply with absent, inactive or mismatched avatar identity."); return RelayDisposition.Consumed; } @@ -333,7 +334,7 @@ namespace NexVerse.Server.Api return false; string candidate = address.Substring(0, at); - if (!candidate.StartsWith("r-", StringComparison.Ordinal)) + if (!candidate.StartsWith("r2-", StringComparison.Ordinal)) return false; localPart = candidate; diff --git a/NexVerse/Server/Api/OglPortalRegistrationApi.cs b/NexVerse/Server/Api/OglPortalRegistrationApi.cs index 7bdb24f7..cc41fa11 100644 --- a/NexVerse/Server/Api/OglPortalRegistrationApi.cs +++ b/NexVerse/Server/Api/OglPortalRegistrationApi.cs @@ -319,12 +319,9 @@ namespace NexVerse.Server.Api "Dieser Avatarname ist bereits vergeben."); return; } - if (m_Accounts.GetUserAccount(UUID.Zero, email) != null) - { - Reply(response, HttpStatusCode.Conflict, "email_registered", - "Die E-Mail-Adresse ist bereits registriert."); - return; - } + // Email is a contact method, not a unique avatar identity. + // Multiple avatars may share it, but avatar names must remain unique. + // Keep validation and machine-key authorization unchanged. if (!TryReadHomeRegion(root, out string homeRegionId, out string homeRegionName, out Vector3 homePosition)) diff --git a/OpenSim/Addons/OfflineIM/OfflineIMRegionModule.cs b/OpenSim/Addons/OfflineIM/OfflineIMRegionModule.cs index 55c7b37e..ce07bc70 100644 --- a/OpenSim/Addons/OfflineIM/OfflineIMRegionModule.cs +++ b/OpenSim/Addons/OfflineIM/OfflineIMRegionModule.cs @@ -473,6 +473,7 @@ namespace OpenSim.OfflineIM { string replyLocalPart = OfflineImMailRelayToken.Create( senderID, + recipientID, recipientAddress.Address, DateTimeOffset.UtcNow.AddDays(m_EmailReplyLifetimeDays), m_EmailRelaySigningKey); diff --git a/OpenSim/Framework/OfflineImMailRelayToken.cs b/OpenSim/Framework/OfflineImMailRelayToken.cs index ac3666fe..3df451bf 100644 --- a/OpenSim/Framework/OfflineImMailRelayToken.cs +++ b/OpenSim/Framework/OfflineImMailRelayToken.cs @@ -30,6 +30,80 @@ namespace OpenSim.Framework return string.Join("-", Prefix, target, expiry, nonce, signature); } + // Identity-bound reply tokens: a shared contact mailbox must not + // cause a reply to be attributed to an arbitrary first account. + public static string Create( + UUID targetAgentId, + UUID replyingAgentId, + string authorizedEmail, + DateTimeOffset expiresAt, + string signingKey) + { + ValidateSigningKey(signingKey); + if (targetAgentId.IsZero() || replyingAgentId.IsZero()) + throw new ArgumentException("Reply token identities must not be zero."); + + string target = Base64Url(targetAgentId.Guid.ToByteArray()); + string replying = Base64Url(replyingAgentId.Guid.ToByteArray()); + string expiry = ToBase36(expiresAt.ToUnixTimeSeconds()); + string nonce = Base64Url(RandomNumberGenerator.GetBytes(NonceBytes)); + string signature = Sign( + "r2|" + target + "|" + replying, expiry, nonce, + NormalizeEmail(authorizedEmail), signingKey); + return string.Join("-", "r2", target, replying, expiry, nonce, signature); + } + + // Deliberately refuses legacy unbound r1 tokens. Their sender identity + // cannot be uniquely determined once more than one avatar uses an email. + public static bool TryValidateReply( + string localPart, + string authorizedEmail, + string signingKey, + DateTimeOffset now, + TimeSpan maximumFutureLifetime, + out UUID targetAgentId, + out UUID replyingAgentId) + { + targetAgentId = UUID.Zero; + replyingAgentId = UUID.Zero; + if (string.IsNullOrWhiteSpace(localPart) || + string.IsNullOrWhiteSpace(authorizedEmail) || + string.IsNullOrWhiteSpace(signingKey)) + return false; + + string[] parts = localPart.Split('-'); + if (parts.Length != 6 || parts[0] != "r2" || + !TryBase64UrlDecode(parts[1], out byte[] targetBytes) || + !TryBase64UrlDecode(parts[2], out byte[] replyingBytes) || + targetBytes.Length != 16 || replyingBytes.Length != 16 || + !TryFromBase36(parts[3], out long expiryUnix)) + return false; + + try + { + DateTimeOffset expiry = DateTimeOffset.FromUnixTimeSeconds(expiryUnix); + if (expiry <= now || expiry > now.Add(maximumFutureLifetime)) + return false; + string expected = Sign( + "r2|" + parts[1] + "|" + parts[2], parts[3], parts[4], + NormalizeEmail(authorizedEmail), signingKey); + if (!FixedTimeEquals(parts[5], expected)) + return false; + + targetAgentId = new UUID(new Guid(targetBytes)); + replyingAgentId = new UUID(new Guid(replyingBytes)); + return !targetAgentId.IsZero() && !replyingAgentId.IsZero(); + } + catch (ArgumentOutOfRangeException) + { + return false; + } + catch (ArgumentException) + { + return false; + } + } + public static bool TryValidate( string localPart, string authorizedEmail, diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index ae334c5b..14983d7b 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -29,6 +29,7 @@ using System; using System.Linq; using System.Collections.Generic; using System.Reflection; +using System.Data.Common; using log4net; using Nini.Config; using OpenMetaverse; @@ -45,6 +46,7 @@ namespace OpenSim.Services.UserAccountService { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static UserAccountService m_RootInstance; + private readonly IConfigSource m_DeletionConfig; /// /// Should we create default entries (minimum body parts/clothing, avatar wearable entries) for a new avatar? @@ -66,6 +68,7 @@ namespace OpenSim.Services.UserAccountService public UserAccountService(IConfigSource config) : base(config) { + m_DeletionConfig = config; IConfig userConfig = config.Configs["UserAccountService"]; if (userConfig == null) throw new Exception("No UserAccountService configuration"); @@ -135,6 +138,12 @@ namespace OpenSim.Services.UserAccountService "create user [ [ [ [ [ []]]]]]", "Create a new user", HandleCreateUser); + MainConsole.Instance.Commands.AddCommand("Users", false, + "delete user", + "delete user [--confirm]", + "Preview deletion of an offline avatar or irreversibly purge core local account data with --confirm", + HandleDeleteUser); + MainConsole.Instance.Commands.AddCommand("Users", false, "reset user password", "reset user password [ [ []]]", @@ -492,6 +501,228 @@ namespace OpenSim.Services.UserAccountService CreateUser(UUID.Zero, principalId, firstName, lastName, password, email, model); } + // Deletes the standard OpenSim local avatar identity from a single + // authoritative DB, inside one transaction. Do not claim that this + // deletes third-party economy, groups, estates, inworld objects or + // shared asset blobs: operators must audit those integrations first. + // If any required store is on another database, refuse the action. + protected void HandleDeleteUser(string module, string[] cmdparams) + { + if (cmdparams.Length != 5 && cmdparams.Length != 6) + { + MainConsole.Instance.Output("Usage: delete user [--confirm]"); + return; + } + + if (cmdparams.Length == 6 && cmdparams[5] != "--confirm") + { + MainConsole.Instance.Output("Only --confirm is supported for permanent deletion."); + return; + } + + if (!UUID.TryParse(cmdparams[4], out UUID userId) || userId.IsZero()) + { + MainConsole.Instance.Output("Specify the exact non-zero avatar UUID from 'show account'."); + return; + } + + UserAccount account = GetUserAccount(UUID.Zero, cmdparams[2], cmdparams[3]); + if (account == null || account.PrincipalID != userId || !account.LocalToGrid) + { + MainConsole.Instance.Output("Deletion refused: avatar name/UUID mismatch or non-local account."); + return; + } + + if (userId == Constants.servicesGodAgentID || account.UserLevel >= 200) + { + MainConsole.Instance.Output("Deletion refused: protected grid service or administrator account."); + return; + } + + if (m_GridUserService == null) + { + MainConsole.Instance.Output("Deletion refused: authoritative GridUserService unavailable."); + return; + } + + try + { + GridUserInfo loginState = m_GridUserService.GetGridUserInfo(userId.ToString()); + if (loginState != null && loginState.Online) + { + MainConsole.Instance.Output("Deletion refused: avatar is currently online. Log out and retry."); + return; + } + + string provider = DeletionStorageSetting("UserAccountService", "StorageProvider"); + string connectionString = DeletionStorageSetting("UserAccountService", "ConnectionString"); + if (string.IsNullOrWhiteSpace(provider) || string.IsNullOrWhiteSpace(connectionString)) + throw new InvalidOperationException("No authoritative UserAccountService database configured."); + + foreach (string service in new[] { + "AuthenticationService", "GridUserService", "InventoryService", + "AvatarService", "PresenceService", "FriendsService" }) + { + if (!string.Equals(provider, DeletionStorageSetting(service, "StorageProvider"), + StringComparison.OrdinalIgnoreCase) || + !string.Equals(connectionString, DeletionStorageSetting(service, "ConnectionString"), + StringComparison.Ordinal)) + throw new InvalidOperationException(service + " uses a different data store. Cross-database purge is unsafe."); + } + + // Only well-known migration realms are supported. No table or + // column names are ever supplied by a console argument. + foreach (string[] realm in new[] { + new[] { "UserAccountService", "UserAccounts" }, + new[] { "AuthenticationService", "auth" }, + new[] { "GridUserService", "GridUser" }, + new[] { "AvatarService", "Avatars" }, + new[] { "FriendsService", "Friends" }, + new[] { "PresenceService", "Presence" } }) + { + IConfig section = m_DeletionConfig.Configs[realm[0]]; + string configuredRealm = section?.GetString("Realm", string.Empty); + if (!string.IsNullOrWhiteSpace(configuredRealm) && + !string.Equals(configuredRealm, realm[1], StringComparison.Ordinal)) + throw new InvalidOperationException("Custom realm for " + realm[0] + " requires manual deletion audit."); + } + + bool postgres = provider.IndexOf("PGSQL", StringComparison.OrdinalIgnoreCase) >= 0; + string providerType = provider.IndexOf("MySQL", StringComparison.OrdinalIgnoreCase) >= 0 + ? "MySql.Data.MySqlClient.MySqlConnection, MySql.Data" + : postgres ? "Npgsql.NpgsqlConnection, Npgsql" + : provider.IndexOf("SQLite", StringComparison.OrdinalIgnoreCase) >= 0 + ? "Mono.Data.Sqlite.SqliteConnection, Mono.Data.Sqlite" : null; + if (providerType == null) + throw new InvalidOperationException("Unsupported database backend for console deletion: " + provider); + + Type type = Type.GetType(providerType, throwOnError: false); + if (type == null || !typeof(DbConnection).IsAssignableFrom(type)) + throw new InvalidOperationException("Database driver unavailable: " + providerType); + + using DbConnection connection = (DbConnection)Activator.CreateInstance(type, connectionString); + connection.Open(); + using DbTransaction transaction = connection.BeginTransaction(); + + // PostgreSQL uses UUID-typed columns for these four records; + // MySQL and SQLite store GUIDs as text. + string[][] rows = new string[][] { + new[] { "tokens", "UUID", "uuid" }, + new[] { "auth", "UUID", "uuid" }, + new[] { "inventoryitems", "avatarID", "text" }, + new[] { "inventoryfolders", "agentID", "text" }, + new[] { "Avatars", "PrincipalID", "uuid" }, + new[] { "GridUser", "UserID", "text" }, + new[] { "Presence", "UserID", "text" }, + new[] { "Friends", "PrincipalID", "text" }, + new[] { "UserAccounts", "PrincipalID", "uuid" } + }; + string quote = postgres || provider.IndexOf("SQLite", StringComparison.OrdinalIgnoreCase) >= 0 ? "\"" : "`"; + string Quote(string name) => quote + name + quote; + // PostgreSQL migration table identifiers are unquoted (folded + // to lowercase). Column names are generally case-preserving, + // except auth/tokens where uuid is an unquoted column. + string TableName(string name) => postgres ? name : Quote(name); + string ColumnName(string table, string column) => + postgres && (table == "auth" || table == "tokens") && column == "UUID" + ? "uuid" : Quote(column); + + // Preflight all required tables before mutating anything. + int[] counts = new int[rows.Length]; + for (int i = 0; i < rows.Length; i++) + { + string[] row = rows[i]; + string sql = "SELECT COUNT(*) FROM " + TableName(row[0]) + " WHERE " + ColumnName(row[0], row[1]) + " = @userId"; + counts[i] = DeletionSql(connection, transaction, sql, userId, postgres && row[2] == "uuid", false); + MainConsole.Instance.Output(" {0}: {1} rows", row[0], counts[i]); + } + + int reverseFriends = DeletionSql(connection, transaction, + "SELECT COUNT(*) FROM " + TableName("Friends") + " WHERE " + ColumnName("Friends", "Friend") + " LIKE @userId", + userId, false, false, true); + MainConsole.Instance.Output(" Friends (reverse): {0} rows", reverseFriends); + + if (counts[8] != 1 || counts[6] != 0) + throw new InvalidOperationException("Account no longer unique or an active Presence session still exists. Nothing deleted."); + + // Release read locks before prompting an administrator. + transaction.Commit(); + + if (cmdparams.Length == 5) + { + MainConsole.Instance.Output("Dry run only. To purge core avatar records: delete user {0} {1} {2} --confirm", + cmdparams[2], cmdparams[3], userId); + MainConsole.Instance.Output("WARNING: Land, rezzed objects, groups, NV$ and external addon/portal data are NOT covered."); + return; + } + + string phrase = "DELETE " + userId; + string confirmation = MainConsole.Instance.Prompt("Enter exactly '" + phrase + "' to irreversibly purge core avatar records", "CANCEL"); + if (!string.Equals(confirmation, phrase, StringComparison.Ordinal)) + { + MainConsole.Instance.Output("Deletion cancelled, no records changed."); + return; + } + + using DbTransaction deletionTransaction = connection.BeginTransaction(); + if (DeletionSql(connection, deletionTransaction, + "SELECT COUNT(*) FROM " + TableName("UserAccounts") + " WHERE " + + ColumnName("UserAccounts", "PrincipalID") + " = @userId", + userId, postgres, false) != 1 || + DeletionSql(connection, deletionTransaction, + "SELECT COUNT(*) FROM " + TableName("Presence") + " WHERE " + + ColumnName("Presence", "UserID") + " = @userId", + userId, false, false) != 0) + throw new InvalidOperationException("Account or login state changed during confirmation."); + + GridUserInfo currentState = m_GridUserService.GetGridUserInfo(userId.ToString()); + if (currentState != null && currentState.Online) + throw new InvalidOperationException("Avatar became online during confirmation."); + + DeletionSql(connection, deletionTransaction, + "DELETE FROM " + TableName("Friends") + " WHERE " + ColumnName("Friends", "Friend") + " LIKE @userId", + userId, false, true, true); + for (int i = 0; i < rows.Length; i++) + { + string[] row = rows[i]; + DeletionSql(connection, deletionTransaction, + "DELETE FROM " + TableName(row[0]) + " WHERE " + ColumnName(row[0], row[1]) + " = @userId", + userId, postgres && row[2] == "uuid", true); + } + + deletionTransaction.Commit(); + m_log.WarnFormat("[USER ACCOUNT]: Administrative core avatar purge committed for {0} ({1})", account.Name, userId); + MainConsole.Instance.Output("Core avatar identity permanently deleted: {0} ({1})", account.Name, userId); + MainConsole.Instance.Output("External groups, parcels, rezzed objects, economy, profile and portal data need a separate audit."); + } + catch (Exception ex) + { + m_log.ErrorFormat("[USER ACCOUNT]: delete user failed for {0}: {1}", userId, ex.Message); + MainConsole.Instance.Output("Deletion aborted / rolled back where supported: {0}", ex.Message); + } + } + + private string DeletionStorageSetting(string sectionName, string name) + { + string fallback = m_DeletionConfig.Configs["DatabaseService"]?.GetString(name, string.Empty) ?? string.Empty; + string sectionValue = m_DeletionConfig.Configs[sectionName]?.GetString(name, string.Empty); + return string.IsNullOrWhiteSpace(sectionValue) ? fallback : sectionValue; + } + + private static int DeletionSql(DbConnection connection, DbTransaction transaction, + string sql, UUID userId, bool guidValue, bool mutate, bool prefix = false) + { + using DbCommand command = connection.CreateCommand(); + command.Transaction = transaction; + command.CommandText = sql; + DbParameter parameter = command.CreateParameter(); + parameter.ParameterName = "@userId"; + parameter.Value = prefix ? userId.ToString() + "%" : + guidValue ? (object)userId.Guid : userId.ToString(); + command.Parameters.Add(parameter); + return mutate ? command.ExecuteNonQuery() : Convert.ToInt32(command.ExecuteScalar()); + } + protected void HandleShowAccount(string module, string[] cmdparams) { if (cmdparams.Length != 4) diff --git a/doc/NexVerse/OFFLINE_IM_MAIL_RELAY.md b/doc/NexVerse/OFFLINE_IM_MAIL_RELAY.md index 3b1f285d..7938c67f 100644 --- a/doc/NexVerse/OFFLINE_IM_MAIL_RELAY.md +++ b/doc/NexVerse/OFFLINE_IM_MAIL_RELAY.md @@ -80,3 +80,17 @@ Change `IMAPHost` if the KeyHelp server uses another mail hostname. 5. Robust polls `relay@im.stadt-nexverse.de`. 6. If A is online, A receives the response immediately as an Inworld-IM. 7. If A is offline, the Gatekeeper stores the reply as an offline IM for the next login. + + +## Gemeinsame E-Mail-Adressen mehrerer Avatare + +Seit dem Mehrfachavatar-Registrierungsupdate darf dieselbe E-Mail-Adresse +mehreren eigenstaendigen Avataren zugeordnet sein. Die bisherige Zuordnung +`GetUserAccount(scope, senderEmail)` ist deshalb nicht mehr eindeutig. +Neue Offline-IM-Antworten benutzen einen signierten `r2`-Reply-Token mit +Empfaenger-/Antwortavatar-UUID. ROBUST loest die antwortende Identitaet +anhand der signierten UUID auf und kontrolliert, dass die Absenderadresse +noch dem aktiven Avatar gehoert. Alte, nicht identitaetsgebundene +`r`-Tokens werden im aktualisierten Relay aus Sicherheitsgruenden +abgewiesen. Fuer den Schnittstellenwechsel muessen Simulator (Sender) +und ROBUST (Empfaenger) gemeinsam aktualisiert werden. diff --git a/doc/NexVerse/PORTAL_REGISTRATION_IAR_HARDENING.md b/doc/NexVerse/PORTAL_REGISTRATION_IAR_HARDENING.md index ba798c42..0d415219 100644 --- a/doc/NexVerse/PORTAL_REGISTRATION_IAR_HARDENING.md +++ b/doc/NexVerse/PORTAL_REGISTRATION_IAR_HARDENING.md @@ -45,8 +45,8 @@ X-NexVerse-Api-Key: - Nur gültige Avatarnamen (2–31 Zeichen; Unicode-Buchstaben, Ziffern, Unterstrich, Bindestrich), E-Mail und Passwörter zwischen 12 und 128 Zeichen werden akzeptiert. -- Doppelter Avatarname ⇒ `409 avatar_name_taken`; registrierte - E-Mail ⇒ `409 email_registered`. Nicht vorbereitete Startervorlage +- Doppelter Avatarname ⇒ `409 avatar_name_taken`; dieselbe + E-Mail darf mehreren Avataren zugeordnet werden. Nicht vorbereitete Startervorlage ⇒ `422 registration_failed`. ### KeyHelp-Reverse-Proxy, HTTP-Backend und Startposition @@ -152,8 +152,7 @@ bedeutet fehlende Freigabe oder einen nicht verfügbaren erfordert Prüfung von Modell-Freigabe und Home-/Last- Initialisierung im ROBUST-Log. `401 unauthorized_portal` deutet auf fehlenden/falschen Key oder Scope hin. -`409 avatar_name_taken`/ `email_registered` bedeutet, -dass ein Name beziehungsweise die E-Mail bereits existiert. +`409 avatar_name_taken` bedeutet, dass der Avatarname bereits existiert.\nDie E-Mail-Adresse darf mehrfach verwendet werden; das E-Mail-Pflichtfeld\nbleibt bestehen. Bei einem Netzwerkausfall nach dem POST vor erneuter Registrierung nachsehen, ob der Avatar bereits angelegt wurde. diff --git a/doc/NexVerse/ROBUST_AVATAR_DELETE.md b/doc/NexVerse/ROBUST_AVATAR_DELETE.md new file mode 100644 index 00000000..0182de34 --- /dev/null +++ b/doc/NexVerse/ROBUST_AVATAR_DELETE.md @@ -0,0 +1,56 @@ +# ROBUST: Avatar sicher entfernen (delete user) + +Stand: 21.10.2026. Gilt fuer den lokalen OpenGenesisLINK-Benutzerkontendienst +auf dem zentralen ROBUST. + +## Konsole + +```text +R.O.B.U.S.T.# show account Vorname Nachname +R.O.B.U.S.T.# delete user Vorname Nachname +R.O.B.U.S.T.# delete user Vorname Nachname --confirm +``` + +Der Befehl **ohne `--confirm` ist eine reine Vorschau**: Name und +UUID muessen genau zusammenpassen. Bei `--confirm` verlangt ROBUST +zusaetzlich die vollstaendige Zeichenfolge `DELETE `. +Bei einer fehlerhaften Eingabe wird nichts entfernt. + +## Voraussetzungen und Schutz + +- Vor einer dauerhaften Loeschung eine getestete Sicherung der ROBUST-DB + und eine kontrollierte Betriebspause vorsehen. Aktive Avatar-Sessions + und aktuelle `Presence`-Eintraege blockieren die Loeschung. +- Loeschung des System-/GRID-SERVICES-Kontos und von UserLevel >= 200 + wird verweigert. Fremde Hypergrid-Identitaeten werden nicht entfernt. +- Alle lokalen Kernspeicher muessen denselben Provider und dieselbe + Verbindungszeichenfolge verwenden. Bei getrennten Datenbanken, + unueblichen Tabellen-Realms oder fehlenden Tabellen verweigert + ROBUST die automatische Loeschung. +- Provider: MariaDB/MySQL, PostgreSQL und SQLite. Der Befehl benutzt + parameterisierte SQL-Anweisungen mit einer Transaktion. +- Der Vorgang entfernt **nur** zentrale Avatar-Daten: + `tokens`, `auth`, `inventoryitems`, `inventoryfolders`, + `Avatars`, `GridUser`, `Presence`, die eigenen und + gegenseitigen `Friends`-Eintraege sowie `UserAccounts`. + Fremde Benutzerkonten mit derselben E-Mail-Adresse bleiben bestehen. + +## Wichtige Grenze: kein vollstaendiger Grid-Cascade-Delete + +Dieser Befehl loescht **noch nicht** automatisch von externen Diensten +und Addons verwaltete Daten: Gruppen, NV$-Guthaben und Buchungen, World API +oder Stadtportal, UserProfiles, IM-Archive, Experiences, Marketplace, +Regionsinventar, Land/Parzellen, gerezzte Objekte oder Hypergrid-Caches. +Insbesondere Asset-Dateien duerfen nicht blind geloescht werden, da +sie von anderen Avataren weiterverwendet werden koennen. + +**Vor dem irreversiblen Schritt** Eigentuemerwechsel oder manuelle +Bereinigung dieser Komponenten einplanen. Der Dienst meldet nur +die Loeschung der zentralen Avataridentitaet als erfolgreich, nicht +eine vollstaendige End-to-End-Datenbereinigung. Fuer eine +datenschutzrechtlich vollstaendige Loeschung sind die unabhaengigen +Systeme getrennt zu pruefen und zu bereinigen. + +Die benutzten Zugangsdaten der Datenbank bleiben in den jeweiligen +INI-/Environment-Einstellungen; keine SQL-Passwoerter in Logdateien +oder im Loeschbefehl angeben. diff --git a/tools/ci/verify_offline_im_mail_relay.py b/tools/ci/verify_offline_im_mail_relay.py index c4c0691c..79a734fc 100644 --- a/tools/ci/verify_offline_im_mail_relay.py +++ b/tools/ci/verify_offline_im_mail_relay.py @@ -10,6 +10,8 @@ for needle in ( "CryptographicOperations.FixedTimeEquals", "RandomNumberGenerator.GetBytes", "TryValidate(", + "TryValidateReply(", + "replyingAgentId", "maximumFutureLifetime", ): assert needle in token, f"relay token helper missing {needle}" @@ -32,13 +34,14 @@ for needle in ( "ImapClient", "SearchQuery.NotSeen", "relay@im.stadt-nexverse.de", - "OfflineImMailRelayToken.TryValidate(", - "GetUserAccount(UUID.Zero, senderEmail)", + "OfflineImMailRelayToken.TryValidateReply(", + "GetUserAccount(UUID.Zero, replyingAgentId)", + "OfflineImMailRelayToken.NormalizeEmail(replyingAccount.Email)", "replyingAccount.LocalToGrid", "IncomingInstantMessage(im)", "MessageFlags.Seen", "MaximumReplyCharacters", - "Ignored catch-all mail from non-NexVerse sender", + "Rejected reply with absent, inactive or mismatched avatar identity", ): assert needle in relay, f"Robust IM mail relay missing {needle}" diff --git a/tools/ci/verify_portal_registration_iar_preflight.py b/tools/ci/verify_portal_registration_iar_preflight.py index 89f72000..4baf2689 100644 --- a/tools/ci/verify_portal_registration_iar_preflight.py +++ b/tools/ci/verify_portal_registration_iar_preflight.py @@ -41,6 +41,29 @@ for marker in ( assert marker in api, "Live name availability API security/contract missing: " + marker assert api.count("if (!AuthorizePortal(request, response))") == 2, "Both routes must share identical security checks." assert api.count("m_Accounts.GetUserAccount(UUID.Zero, first, last)") >= 2, "Live lookup must match final POST lookup." +assert '"email_registered"' not in api, "Email contact address is reusable for multiple avatars" +assert "m_Accounts.GetUserAccount(UUID.Zero, email)" not in api, "Do not treat shared email as unique avatar identity" +assert "if (!IsValidEmail(email))" in api, "Contact email remains mandatory and syntactically validated" +account_deletion = Path("OpenSim/Services/UserAccountService/UserAccountService.cs").read_text() +for marker in ( + '"delete user"', + 'HandleDeleteUser', + '"--confirm"', + '"DELETE " + userId', + 'GetGridUserInfo(userId.ToString())', + 'connection.BeginTransaction()', + 'deletionTransaction.Commit()', + '"UserAccounts", "PrincipalID"', + '"inventoryitems", "avatarID"', + '"inventoryfolders", "agentID"', + '"auth", "UUID"', + '"tokens", "UUID"', + '"Avatars", "PrincipalID"', + '"GridUser", "UserID"', + '"Friends", "PrincipalID"', +): + assert marker in account_deletion, "Missing safe ROBUST avatar deletion boundary: " + marker + assert api.index("NexScopes.UsersRegister") < api.index("public void HandleNameAvailability(") assert api.index("public void HandleNameAvailability(") < api.index("public void Handle(") assert "X-NexVerse-Api-Key" in api and "HttpStatusCode.Created" in api