Ignore:
Timestamp:
2014-03-13T14:34:48+13:00 (10 years ago)
Author:
ak19
Message:

First security commit. 1. Introducing the new securitools.h and .cpp files, which port the functions necessary to implement security in Greenstone from OWASP-ESAPI for Java, since OWASP's C++ version is largely not yet implemented, even though their code compiles. The newly added runtime-src/packages/security which contains OWASP ESAPI for C++ will therefore be removed again shortly. 2. receptionist.cpp now sets various web-encoded variants for each cgiarg macro, such as HTML entity encoded, attr encoded, javascript encoded (and css encoded variants). These are now used in the macro files based on which variant is suited to the context. 3. This commit further contains the minimum changes to protect the c, d, and p cgi variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/recpt/queryaction.cpp

    r28841 r28888  
    10101010
    10111011    // Display the "this collection is not installed on this system" page
    1012     disp.setmacro("cvariable", displayclass::defaultpackage, main_collection);
     1012    disp.setmacro("cvariable", displayclass::defaultpackage, encodeForHTML(main_collection));
    10131013    disp.setmacro("content", "query", "<p>_textbadcollection_<p>");
    10141014
     
    13941394    }
    13951395
    1396     disp.setmacro ("decodedcompressedoptions", displayclass::defaultpackage, dm_safe(compressedoptions));
     1396    text_t macrovalue = dm_safe(compressedoptions);
     1397    disp.setmacro ("decodedcompressedoptions", displayclass::defaultpackage, macrovalue);
     1398    disp.setmacro ("decodedcompressedoptionsAttrsafe", displayclass::defaultpackage, encodeForHTMLAttr(macrovalue));
     1399   
    13971400      }
    13981401    } // form search
Note: See TracChangeset for help on using the changeset viewer.