From 7d3bafd5abf22f5c1ea3c3d8918d9b8177693bda Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 4 Mar 2015 17:43:00 +0000
Subject: Add outbound URL filter to llHttpRequest() and
osSetDynamicTextureURL*() script functions.
This is to address an issue where HTTP script functions could make calls to localhost and other endpoints inside the simulator's LAN.
By default, calls to all private addresses are now blocked as per http://en.wikipedia.org/wiki/Reserved_IP_addresses
If you require exceptions to this, configure [Network] OutboundDisallowForUserScriptsExcept in OpenSim.ini
---
.../Region/Framework/Interfaces/IHttpRequests.cs | 37 +++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Interfaces')
diff --git a/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs b/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs
index 113dcd7..124504c 100644
--- a/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs
+++ b/OpenSim/Region/Framework/Interfaces/IHttpRequests.cs
@@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+using System;
using System.Collections.Generic;
using OpenMetaverse;
@@ -41,10 +42,44 @@ namespace OpenSim.Region.Framework.Interfaces
HTTP_PRAGMA_NO_CACHE = 6
}
+ ///
+ /// The initial status of the request before it is placed on the wire.
+ ///
+ ///
+ /// The request may still fail later on, in which case the normal HTTP status is set.
+ ///
+ [Flags]
+ public enum HttpInitialRequestStatus
+ {
+ OK = 1,
+ DISALLOWED_BY_FILTER = 2
+ }
+
public interface IHttpRequestModule
{
UUID MakeHttpRequest(string url, string parameters, string body);
- UUID StartHttpRequest(uint localID, UUID itemID, string url, List parameters, Dictionary headers, string body);
+
+ ///
+ /// Starts the http request.
+ ///
+ ///
+ /// This is carried out asynchronously unless it fails initial checks. Results are fetched by the script engine
+ /// HTTP requests module to be distributed back to scripts via a script event.
+ ///
+ /// The ID of the request. If the requested could not be performed then this is UUID.Zero
+ /// Local ID of the object containing the script making the request.
+ /// Item ID of the script making the request.
+ /// Url to request.
+ /// LSL parameters for the request.
+ /// Extra headers for the request.
+ /// Body of the request.
+ ///
+ /// Initial status of the request. If OK then the request is actually made to the URL. Subsequent status is
+ /// then returned via IServiceRequest when the response is asynchronously fetched.
+ ///
+ UUID StartHttpRequest(
+ uint localID, UUID itemID, string url, List parameters, Dictionary headers, string body,
+ out HttpInitialRequestStatus status);
///
/// Stop and remove all http requests for the given script.
--
cgit v1.1