Better HN
topnewbestaskshowjobs
Log inSign up

DCoder

1,260 karma · joined Nov 2, 2009 (17y ago) · 479 submissions

not here anymore
Submissions

comment 9y ago · link · parent

The parent post said "only implementations using sendmail (ie. not mail() or SMTP) are affected".

From my reading of the code, "only implementations using mail() (ie. not sendmail or SMTP) are affected".

comment 9y ago · link · parent

That's not correct, the added escapeshellarg() call is inside the mailSend() function, which sends mail through php's mail(). See [1].

[1]: https://github.com/PHPMailer/PHPMailer/blame/4835657cd639fbd...

comment 9y ago · link · parent

That added call to escapeshellarg sanitizes the "From" address before passing it to PHP's mail() function as an additional parameter. That function will invoke a preconfigured executable (sendmail or a compatible wrapper) and pass that parameter to it along with the rest of the email data. It is worth noting that:

1) PHPMailer can be configured to send mail through raw SMTP, by directly invoking sendmail, or by calling PHP's mail() function. The changes in this commit only affect the last mode.

2) The "From" address is typically chosen by the site operator/server administrator, not customizable by a site visitor. I have built sites with "share this page with a friend" functionality that sent email from one given email address to another, but this practice seems to have fallen out of favour when SPF became popular.

comment 9y ago · link · parent

Or, once they have learned the alien language, they see legitimate shortcomings in it that their native language doesn't have.

comment 9y ago · link · parent

Web dev chiming in with a similar experience. Last month I interviewed three people claiming multiple years of PHP/MySQL experience, not one of them could tell me what an SQL transaction is.

comment 9y ago · link · parent

Thank you for the contact details, I'll send you the details of the security issues later this week.

This extension was purchased through Magento Connect just a few months ago. I'm glad to hear the situation is improving now.

comment 9y ago · link · parent

> utf8mb4 comes with some technical "gotchas" (google it)

I know InnoDB limits index sizes to 767 bytes, meaning VARCHAR(255) using utf8 can have all 255 characters indexed, but VARCHAR(255) using utf8mb4 can only index 191 characters (floor(767/4) == 191).

After a quick Google search, that seems to be the most common gotcha. What other gotchas did you have in mind?

comment 9y ago · link · parent

Out of curiosity, what makes 42030 better than MB Arocs (42043) or Mobile Crane II (42009)? I was just looking for a gift for myself a week ago, and 42043 looks great.

comment 9y ago · link · parent

Excel has Get & Transform, formerly known as Power Query, which can do similar things... if a custom query language [1] instead of SQL doesn't scare you away. I have used it a few times, it can definitely be useful.

[1]: https://msdn.microsoft.com/en-us/library/mt270258.aspx

comment 9y ago · link · parent

Perl has such a feature, it's called "taint mode" [1], it marks all variables receiving external data as "tainted" and disallows their usage in sensitive contexts.

PHP has an inactive proposal to implement it as well [2].

[1] http://perldoc.perl.org/perlsec.html#Taint-mode

[2] https://wiki.php.net/rfc/taint

comment 9y ago · link · parent

The bigger problem is that Google ranks that website higher than the modern stuff. You can make much better tutorials and it won't help as long as that legacy cruft is sitting at the top of every newbie's search results.

comment 9y ago · link · parent

It gets worse: https://3v4l.org/Slvpp

Note that PHP also has a JavaScript-style triple-equals comparison, which does not attempt type conversion and does not exhibit this bizarre behaviour.

comment 9y ago · link · parent

How so?

comment 9y ago · link · parent

> You can also escape the scans by using variable names that start with an underscore

So people who use

    "WHERE id=" . $_GET['id']
will not get detected?

comment 9y ago · link · parent

Variable table names can also be useful if you have poor man's partitioning – separate tables with historical data , like "logs_201610", "logs_201611", "logs_201612", etc.

Another scenario I just thought of: your schema is more or less dynamic. For example, Drupal lets developers/site administrators create entities with custom fields, each field gets its own DB table, and to load an entity you need to

    SELECT * FROM node
    LEFT OUTER JOIN field_data_field_name_1 ON .. 
    LEFT OUTER JOIN field_data_field_name_2 ON ..
    ...

comment 9y ago · link · parent

> it's not really representative of the sector of developers that make a living with PHP.

Anecdote: I was integrating a paid Magento extension (which charges about $1000 for a license) into an existing shop, and some poor code in their templates made me look deeper into their main code. Six hours later, I had:

* 4 different ways to read any file on the server that PHP can read,

* 5 different ways to upload any file to a certain directory on the server, including one that lets you overwrite the webserver's security configuration for that directory and then execute uploaded PHP code,

* a way to delete certain things the administrator has created in the backend,

* a way to overwrite other customers' uploaded files,

* a way to edit other customers' information, which lets you then XSS/XSRF those customers when they view that information.

I have reviewed other Magento extensions in the past, and I found many poor ones, but nothing as atrocious as this.

comment 9y ago · link · parent

That's what happens when you use Regexes to find problems: https://github.com/laurent22/so-sql-injections/blob/7b9d99c0...

comment 9y ago · link · parent

Yes, Ansible supports conditionals and loops in its playbooks. Ansible 2.0 also introduced blocks, which are effectively a try-catch-finally in disguise.

comment 9y ago · link · parent

https://v8project.blogspot.com/2016/12/v8-release-56.html says:

> V8 version 5.6, which will be in beta until it is released in coordination with Chrome 56 Stable in several weeks...

> Starting with 5.6, V8 can optimize the entirety of the JavaScript language.

comment 10y ago · link · parent

> Can you remember all services you signed up for with your email? Cause I definitely didn't.

You might also want to check your browser settings to see which domains have saved cookies, saved passwords, or the "never save passwords on this domain" flag.

comment 10y ago · link · parent

Browser language preferences, yes. Keyboard layout, no. For one thing, layout names vary between OSes, for another, custom keyboard layouts are a thing... However, you can try and read individual keypress events and see which printable characters are generated for which key codes.

comment 10y ago · link · parent

We never lost control

You're face to face

With the man who sold the world

comment 10y ago · link · parent

You're not the only one who feels that way :)

comment 10y ago · link · parent

The email field in your profile is private. Add your email to the "About" field for others to see it.

comment 10y ago · link · parent

Amanda Palmer's rendition is amazing as well: https://www.periscope.tv/w/1DXxyoEbXBLGM (starting at 3:01:56).

comment 10y ago · link · parent

Typically parameterized query APIs (such as PHP's PDO) only support dynamic parameters for elements that do not affect the query plan, that is, as replacements for literal strings or numbers. Dynamic identifiers, such as table/column names, sort direction, etc., are not allowed. This permits an additional benefit – the DB can compile a prepared statement once and reuse its compiled form for multiple executions.

comment 10y ago · link · parent

In case of KeePass at least, you can skip the master password and use keyfiles or HOTP such as Yubikey instead. Or, better yet, you can combine the master password with one of those.

comment 10y ago · link · parent

No problem :) I just edited the post to add some more security implications, because they deserve more attention.

comment 10y ago · link · parent

Yep, I've seen such issues in multiple systems as well.
1
678
16