Page 2 of 3
Re: It is not ready yet, but...
Posted: Tue Mar 29, 2016 7:10 pm
by Rathinagiri
Thanks Roberto.
This gives some insight into the subject. I think I have to read a LOT!
https://stackoverflow.com/questions/2821 ... t-involves
Re: It is not ready yet, but...
Posted: Tue Mar 29, 2016 7:34 pm
by Roberto Lopez
After reading that thread, there is no so much hope

Re: It is not ready yet, but...
Posted: Wed Mar 30, 2016 2:57 am
by Rathinagiri
I think the combo of the two may work out.
A generic PHP script which can build a query from the necessary parameters.
var data = Querier({
table: "mytable",
columns: {"column1", "column2", "column3"},
where: {
column2: {
op: '=',
value: 'blablabla'
}
}
limit: "10"
});
In the script we can add some prefix to the table names and then build the query in the script using the available parameters.
Re: It is not ready yet, but...
Posted: Wed Mar 30, 2016 5:51 am
by mol
It's really hard theme to realize security policies...
Re: It is not ready yet, but...
Posted: Wed Mar 30, 2016 12:58 pm
by Roberto Lopez
Rathinagiri wrote:I think the combo of the two may work out.
<...>
Being such a sensitive theme, IMHO, the best way to go, is to keep JMG 'neutral' about this, so the user can make the decision that consider most convenient.
Re: It is not ready yet, but...
Posted: Wed Mar 30, 2016 1:40 pm
by serge_girard
IMO the best is to keep all SQL stuff away from JS, so only in PHP.
Greetings, Serge
Re: It is not ready yet, but...
Posted: Wed Mar 30, 2016 1:49 pm
by luisvasquezcl
Dear, IMHO, for security is not advisable to create the SQL statement in javascript since the database, however, is fully exposed is better to make a generic script in php for data manipulation.
Totally agree with Serge.
best regards
luis vasquez
Re: It is not ready yet, but...
Posted: Wed Mar 30, 2016 2:02 pm
by serge_girard
And beware of (blind) SQL injection !
Each input must be checked, controlled and parsed before execution.
Serge
Re: It is not ready yet, but...
Posted: Wed Mar 30, 2016 2:05 pm
by Rathinagiri
Thank you Serge. I do agree with you now. Obscurity is the starting point of security.
Re: It is not ready yet, but...
Posted: Wed Mar 30, 2016 3:36 pm
by serge_girard
Best screening of user-input is done in 2 ways: Javascript on client and PHP on server.
Blind SQL injection are URL's like :
Code: Select all
https://hmgforum.com/viewtopic.php?f=50&t=4677&start=10 OR 1=1
OR
https://hmgforum.com/viewtopic.php?f=50&t=4677&start=10%20OR%201=1
Which can cause a lot trouble! Each parameter should carefully be inspected before assuming to be OK.
Serge