Changes between Initial Version and Version 1 of MapGuideRfc136


Ignore:
Timestamp:
Jun 17, 2013, 2:01:15 AM (11 years ago)
Author:
jng
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc136

    v1 v1  
     1
     2= !MapGuide RFC 126 - Remove EXECUTESQLQUERY from the mapagent =
     3
     4This page contains a change request (RFC) for the !MapGuide Open Source project.
     5More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page.
     6
     7
     8== Status ==
     9
     10||RFC Template Version||(1.0)||
     11||Submission Date||17 Jun 2013||
     12||Last Modified||17 Jun 2013||
     13||Author||Jackie Ng||
     14||RFC Status||draft||
     15||Implementation Status||||
     16||Proposed Milestone||2.6, 2.5.1, 2.4.1||
     17||Assigned PSC guide(s)||(when determined)||
     18||'''Voting History'''||(vote date)||
     19||+1||||
     20||+0||||
     21||-0||||
     22||-1||||
     23||no vote|| ||
     24
     25== Overview ==
     26
     27This RFC proposes to remove support for the EXECUTESQLQUERY operation from the mapagent HTTP interface.
     28
     29== Motivation ==
     30
     31The EXECUTESQLQUERY operation in its current form poses a dangerous security risk due to the lack of any safeguards in the MapGuide or FDO APIs to ensure the SQL being executed is only a SELECT query and not INSERT/UPDATE/DELETE or DML like DROP/ALTER TABLE/ALTER COLUMN
     32
     33The Anonymous MapGuide user account has unfettered access to this operation and given knowledge of the repository layout (also accessible by the Anonymous account) and the Feature Source structure (also accessible by the Anonymous account) a malicious Anonymous MapGuide session has enough knowledge to cause serious damage to any Feature Source whose FDO provider supports SQL commands.
     34
     35RDBMS-based FDO providers can mitigate this through the use of security options provided by the underlying DBMS (eg. A DBMS user account with read-only table access). Using credentials for a sufficiently locked down DBMS user account is sufficient to stop such an attack.
     36
     37However, FDO providers like SQLite do not have any notion of security at the DBMS level and will still be vulnerable to this type of attack.
     38
     39The risks to having this operation in the mapagent interface outweigh the benefits. For the purposes of query feature data over http, the SELECTFEATURES and SELECTAGGREGATES operations already satisfy this requirement.
     40
     41This vulnerability affects any '''public facing''' MapGuide installation that serves spatial data from SQLite or RDBMS-based feature sources with inadequate DBMS-level security restrictions in place.
     42
     43== Proposed Solution ==
     44
     45Removing the EXECUTESQLQUERY from the mapagent is enough to address this security risk.
     46
     47Access to the MgFeatureService.ExecuteSqlQuery() API is still presumed to be safe API to use given proper web application security practices employed on behalf of the MapGuide application developer to prevent common attack vectors like SQL injection.
     48
     49Given the severity of this issue, this RFC is targeted for not just the 2.6 milestone, but also for 2.5.1 and 2.4.1 point release milestones as well. If given enough demand, patched MgHttpHandler.dll files for 2.2 will also be made available.
     50
     51For older releases of MapGuide outside the scope of this RFC, administrators can apply request filtering at the IIS/Apache level to block this type of request [discussion required here].
     52
     53For Apache:
     54{{{
     55TBD. Discussion required.
     56}}}
     57
     58For IIS:
     59{{{
     60TBD. Discussion required.
     61}}}
     62
     63== Implications ==
     64
     65This RFC will break applications that use this mapagent API. Developers reliant on this API can implement a replacement using the Web Extensions API, but should be mindful about sanitizing and validating the input SQL that gets passed down to MgFeatureService.ExecuteSqlQuery()
     66
     67== Test Plan ==
     68
     69Verify EXECUTESQLQUERY requests now throws MgInvalidOperationException
     70
     71== Funding / Resources ==
     72
     73Community