2. I am beginning to build a bit on the item above in order to explicitly escape the table names and sql column names via whitelisting(the goal is to use whitelisting rather than “sanitization” since it seems much cleaner that way and keeps things more compartmentalized). Here’s the code, so can follow the direction I am going in (note this code is not yet fully tested): http://github.com/bradymiller/openemr/commit/bde37a78d6ba9dbd35fcfa781c16819d5472e406
Here’s a commit that effectively whitelists sql columns and table names to not allow sql injection when using them as parameters. I also incorporated this into the Messages module along. Additionally, I incorporated this (and other components of the security model) into the Forms module and specifically converted the Dication and Work/School form. Testing well so far. Please review/test and let me know your thoughts on this: http://github.com/bradymiller/openemr/commit/ecc7156e7027172ec06ff9807b0c89bc65bd12c8
I have no official testing plan. In regards to the sql-injection and cross-scripting with, we should now hopefully have the elements/functions in place to secure this. Now, the code needs to be continued to be walked through and secured a module/script at a time.
A sql injection vector I used to play around in the messages module is the following(a white hat provided it), which will time out mysql for a bit (can test it by placing it within the possible get parameters in the messages script):
(case(select 1 and 1=sleep(5)) when 1 then pnotes.title end)
For cross-scripting, this is easier, just place(either place it in the get parameters of script or enter it into the forms):
<script>alert(“hey”)</script>
And if a pop up stating “hey” shows up(on the screen if place in a get parameter or when the form is shown when enter it into a form), then it is a vulnerability.
To test on a global level, would need a group or somebody to do a scan/analysis at some point in the future after the walk code walk through is complete. We could always ask Tim about that (ie. what is needed and the resources it takes etc.) in the conference call this week.
As you know im a big fan of all the great work you do here for OpenEMR
May I suggest that you set up a test server and let us pen test on it?
I was interested in using the demo but as you know admin and pass are going to be guessed off the get go!
If you set it all up with unknown variable’s we will have our poc if someone gains access.
Or downloads PHI from database
Do you have any ideas about a simulating a war game on the software platform?
DVWA
Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, help web developers better understand the processes of securing web applications and aid teachers/students to teach/learn web application security in a class room environment. http://www.dvwa.co.uk/
The above code is testing very well, so I just committed it to sourceforge.
Regarding the test server, sounds like a good idea, although I don’t have the time to set it up. But anybody else can set up one. I’d be rather surprised if there are any pre-authentication vulnerabilities, but anything is possible. And of course, if anybody finds any, please let us know. The current sql-injection and cross-scripting vulnerabilities in OpenEMR are post-authentication vulnerabilities (meaning, one needs to be logged into OpenEMR to do harm). There are still a lot of these in OpenEMR and there is still lots of legacy code to convert over to the new security module. Hopefully others will begin to join in on the code walk through to convert the legacy code to the new security model (it’s something I’ve been doing off/on for the last 3 years (the lifespan of this forum thread), but there’s still a lot more code to convert).
We would like to use following tools to test OpenEMR security.
1. Netsparker community edition 2.3.0.18 for detecting ClearText password submission and Cross site scripting
2. XSS-Me is a firefox add-on for Cross Site Scripting Testing
3. SQL-Me is a firefox add-on for SQL injection testing
4. SQLMap 0.9 for SQL Injection testing
5. ZAP tool for Cross site scripting
Like Rob suggested, we would like to have test server configured correctly so that the real security issues will get revealed
Sounds like a good plan. Looking forward to see how OpenEMR fares on your testing (I am guessing that the cross-scripting/sql injection list will be long; it will also be very useful to see if there are any of these vulnerabilities in the code that uses the new security model).
I don’t have the time to set up an online test server and am a bit unclear what the configuration settings of the test server should be. Will just installing the most recent OpenEMR development branch locally on your server suffice for your testing?
Folder of interest on domain below " / " (Strictly related to security “phpbb” unreleased patches)
allow index (soon to go away) http://openemr.bugs3.com/flashvortex.swf “Just a domain marker for the time being”
Maybe more one day I need some dedicated server space with high bandwidth allowances…
I will let you know when I move to production on this its development stage now.
personal test site (offline)
Feel free to join the private discussion add your own
Just wanted to post some thing I came across late last night
New generation of BackTrack http://www.kali.org/
Have not tried it yet maybe this weekend when I have some time
-Rob
BTW
This is what they are saying about it!
From the creators of BackTrack comes Kali Linux, the most advanced and versatile penetration testing distribution ever created. BackTrack has grown far beyond its humble roots as a live CD and has now become a full-fledged operating system. With all this buzz, you might be asking yourself: - What’s new ?