User tests: Successful: Unsuccessful:
Including the SQL query in the Exception message is a mild information disclosure in that it displays to the user the failed SQL query and exposes information about the database structure. This PR removes the query from the Exception message retaining only the engine's error message.
The JDatabaseExceptionExecuting
object has a $query
property (accessible via getQuery()
) that contains the failed SQL query. For debugging purposes, if you need access to the failed query, you should extract it from the Exception's property versus relying on the message.
Create a query failure that triggers the error page. Pre-patch, the error message will contain the query. Post-patch, it will not.
Note that the query is not exposed as part of the Exception message any longer, developers must read it from the JDatabaseExceptionExecuting
object's $query
property.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries Postgresql MS SQL |
I have tested this item
Didn't remember that was there. Either way the change needs to be merged in sooner than later. I don't know why there's a bad test on that other PR because there is no code change to duplicate the error output.
I have tested this item
fully agree, i close mine in favour of this one.
p.s.
the bad test on the other one should be because of the tested query was executed twice
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Milestone |
Added: |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-01-02 00:57:40 |
Closed_By | ⇒ | rdeutz |
@test I used a cli script to test this and works as expected using MySQL database.
Executed script before patch:
Executed script after patch:
Script used here: https://github.com/fastslack/joomla-cli-tools/blob/master/JoomlaTests/issue-13356/Issue13356