security.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <sect1 id="security">
  2. <title>HTTP Client Security</title>
  3. <para>&neon; is intended to be secure against a specific threat
  4. model: use of a malicious HTTP server. Under this threat model, a
  5. range of attacks are possible against a client when the user (or
  6. application) can be tricked into accessing an HTTP server which is
  7. controlled by an attacker. This section documents various types of
  8. possible attack and describes what mitigation is used in
  9. &neon;.</para>
  10. <sect2>
  11. <title>CPU or memory consumption attacks</title>
  12. <para>&neon; uses fixed resource limits to prevent the following
  13. attacks:</para>
  14. <itemizedlist>
  15. <listitem>
  16. <para>memory/CPU consumption attack using an unbounded number
  17. of response header fields</para>
  18. </listitem>
  19. <listitem>
  20. <para>memory consumption attack using an unbounded length of
  21. individual response header lines (or continuation
  22. headers)</para>
  23. </listitem>
  24. <listitem>
  25. <para>memory consumption attack against the PROPFIND code
  26. using an unbounded number of properties (propstat elements)
  27. per resource</para>
  28. </listitem>
  29. <listitem>
  30. <para>memory consumption attack against the PROPFIND code
  31. using an unbounded CDATA element in a "flat property"
  32. value</para>
  33. </listitem>
  34. </itemizedlist>
  35. <para>Memory consumption attacks against applications based on
  36. &neon; by use of unbounded response length are also possible, but
  37. must be mitigated at application level. Memory consumption in
  38. &neon; itself is fixed and is not proportional to the response
  39. size.</para>
  40. <para>Test cases for all the above attacks are present in the
  41. &neon; test suite.</para>
  42. </sect2>
  43. <sect2>
  44. <title>SSL/TLS connection security</title>
  45. <para>When using a connection secured by SSL/TLS, it is necessary
  46. for clients to verify that the X.509 certificate presented by the
  47. server matches the server's expected identity. The algorithm
  48. required for this purpose is described in RFC 2818 and RFC 3280,
  49. and is implemented by &neon; in the following manner:</para>
  50. <itemizedlist>
  51. <listitem>
  52. <para>the hostname argument passed to <xref
  53. linkend="ne_session_create"/> is the expected identity of the
  54. server</para>
  55. </listitem>
  56. <listitem>
  57. <para>the subjectAltName extension of the certificate is used
  58. for comparison against the expected identity, in preference
  59. to the Subject name's commonName attribute.</para>
  60. </listitem>
  61. <listitem>
  62. <para>the dNSName, iPAddress, and uniformResourceIdentifier
  63. classes of GeneralName are supported in subjectAltName
  64. comparison.</para>
  65. </listitem>
  66. <listitem>
  67. <para>if no subjectAltName is present in the certificate, the
  68. most specific commonName attribute in the Subject name is used
  69. for comparison instead.</para>
  70. </listitem>
  71. </itemizedlist>
  72. <para>In the case where a server certificate is presented that
  73. does not match the expected identity (or is otherwise not
  74. trusted), &neon; will fail the request by default. This behaviour
  75. can be overridden by the use of a callback installed using <xref
  76. linkend="ne_ssl_set_verify"/>, which allows the application to
  77. present the certificate details to a user for manual/off-line
  78. verification, if possible.</para>
  79. <para>Test cases for the correctness of the implementation of the
  80. identity verification algorithm are present in the &neon; test
  81. suite.</para>
  82. </sect2>
  83. <sect2>
  84. <title>Control character insertion in error messages</title>
  85. <para>Where error messages (as returned by
  86. (<xref linkend="ne_get_error"/>) contain data supplied by the
  87. server, the untrusted data is sanitised to remove both control
  88. characters and non-ASCII characters. This prevents any attacks
  89. where such error messages are exposed to the user and can
  90. potentially distort the presentation of the interface (for
  91. example, through the use of a carriage return character in a text
  92. user interface).</para>
  93. </sect2>
  94. <sect2>
  95. <title>Attacks against authentication credentials</title>
  96. <para>Authentication credentials can be compromised by a
  97. "downgrade attack" by an active attacker; for example, where a
  98. MITM presents a Basic authentication challenge in place of the
  99. server's Digest challenge. &neon; mitigates these attacks by
  100. allowing the application (and hence, user) to specify that only a
  101. specific set of authentication protocols is permitted.</para>
  102. <para>&neon; supports the Digest and Negotiate authentication
  103. schemes, which both allow authentication of users without passing
  104. credentials in cleartext over the wire. The "domain" parameter is
  105. supported in Digest, allowing the server to restrict an
  106. authentication session to a particular set of URIs.</para>
  107. </sect2>
  108. </sect1>