Yesterday I received an email stating that indexed_search is voulnerable to SQL injection by backend users in version 4.1.3, which was the one running on my server. First of all I appreciate the security team very much, the work they do to handle security issues is of a very high value to the community. I have once tried to have a site taken over, because I did not understand the importance of reacting quickly on security issues for such a widely spread CMS like TYPO3. Therefore I think it's a must to recieve updates on security issues, if you manage installation/updating TYPO3.
All this talk about SQL injection made me think about what could be done to prevent these problems. Obviously better coding will make this impossible, but since there seems to be no magical upcoming solution to lack-of-knowledge and/or human stupidity, this would be hard to do.
Then it came to my mind: "How do you actually use a security flaw to harm a website?". It would be unnecessary to prove that if someone gains admin access to your site, that you would be in deep trouble. But what would someone need to inject to gain that kind of acces? Somehow you would need to create a backend user with admin privileges. As I have never done any SQL injection I can only speculate, but for some reason, I keep thinking that you must know which table and the structure of this, to be able to create the admin user.
This is really easy with TYPO3 since all pages have the same tablenames and structure. But what if TYPO3 required you to set a prefix to your database tables? Would this not make SQL injection a lot harder to accomplish? Again I really have no idea about the ways you can exploit an SQL injection, it just seems like a straight forward solution.
For another idea, how about enabling the person who install TYPO3 to split front-end tables and backend-tables into two databases. Then the extension should only be allowed to operate on the front-end database. I don't know if this would be bad for performance or other things, so please don't think of it as a fact.
Are these thought totally useless? Let me hear some comments.
Suggestion-1 is called "security through obscurity", which in general is pretty useless in case of a really aggressive offender.
Suggestion-2 can already be done via DBAL (AFIR). However this wont keep an offender from injecting some XSS into the Frontend (or deface your site) and get logged-in BE-Users to view the infected page and execute whatever scripted action he like. Thus this is no meaninful option eighter.
In general:
- The openness of GPL-Software in combination with a vivid developer- and user-community resulting in discoveries and fast fixes is probably the best assurance you could get. (Thanks and cheers to the security-, release- and core-team!)
- In addition I (again) advcoate for finally getting TYPO3 security-audited and officially security certified.
links:
------
ONR 17700
http://www.on-norm.at/publish/2104.html
ISO 27001 (previous BS 7799)
http://en.wikipedia.org/wiki/ISO_27001