All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] test-pkg script can't handle captive portals. etc.
@ 2017-02-28 20:30 Marcus Hoffmann
  2017-03-01  8:46 ` Arnout Vandecappelle
  2017-03-01 20:06 ` Yann E. MORIN
  0 siblings, 2 replies; 5+ messages in thread
From: Marcus Hoffmann @ 2017-02-28 20:30 UTC (permalink / raw)
  To: buildroot

Hey,

I just ran into an issue with the test-pkg script.
When the TOOLCHAINS_URL returns an unexpected result,
(A router login page, when the Internet got disconnected, a captive
portal login page, a MITM attack, etc.) the script does weird things and
outputs something like this:

    html>: FAILED
<!DOCTYPE: FAILED
     HTML: FAILED
     HTML: ^[ORFAILED
     EN">:
[...]

It also creates the corresponding folders inside the test-dir.

You can test this when pointing the TOOLCHAINS_URL var to any html page.

This it not a very nice way to fail and may lead to harm when parsing
untrusted input from the web.

What would be the best way to handle this case? Can the Toolchain URL be
switched to https? This would eliminate the problem.

Otherwise we should do some sanity checking that no stray html page is
returned by the curl call. But this still doesn't solve the problem of a
malicious actor.

Best wishes,
Marcus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] test-pkg script can't handle captive portals. etc.
  2017-02-28 20:30 [Buildroot] test-pkg script can't handle captive portals. etc Marcus Hoffmann
@ 2017-03-01  8:46 ` Arnout Vandecappelle
  2017-03-01 11:09   ` Marcus Hoffmann
  2017-03-01 20:32   ` Thomas Petazzoni
  2017-03-01 20:06 ` Yann E. MORIN
  1 sibling, 2 replies; 5+ messages in thread
From: Arnout Vandecappelle @ 2017-03-01  8:46 UTC (permalink / raw)
  To: buildroot



On 28-02-17 21:30, Marcus Hoffmann wrote:
> Hey,
> 
> I just ran into an issue with the test-pkg script.
> When the TOOLCHAINS_URL returns an unexpected result,
> (A router login page, when the Internet got disconnected, a captive
> portal login page, a MITM attack, etc.) the script does weird things and
> outputs something like this:
> 
>     html>: FAILED
> <!DOCTYPE: FAILED
>      HTML: FAILED
>      HTML: ^[ORFAILED
>      EN">:
> [...]
> 
> It also creates the corresponding folders inside the test-dir.
> 
> You can test this when pointing the TOOLCHAINS_URL var to any html page.
> 
> This it not a very nice way to fail and may lead to harm when parsing
> untrusted input from the web.
> 
> What would be the best way to handle this case? Can the Toolchain URL be
> switched to https? This would eliminate the problem.

 I don't think a.b.o has https at the moment, though I guess it would be easy to
add a Let's Encrypt certificate.

 Still, a captive portal with an accepted certificate could still play tricks.
It's probably better to validate the result.

 However, I think it would be much nicer if we could just have the toolchain
defconfigs inside of Buildroot instead of using this CSV file.


> Otherwise we should do some sanity checking that no stray html page is
> returned by the curl call. But this still doesn't solve the problem of a
> malicious actor.

 I don't think a malicious actor is really something we should worry about here,
is it?

 Regards,
 Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] test-pkg script can't handle captive portals. etc.
  2017-03-01  8:46 ` Arnout Vandecappelle
@ 2017-03-01 11:09   ` Marcus Hoffmann
  2017-03-01 20:32   ` Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Marcus Hoffmann @ 2017-03-01 11:09 UTC (permalink / raw)
  To: buildroot

Hey,

On 01.03.2017 09:46, Arnout Vandecappelle wrote:
> 
> 
> On 28-02-17 21:30, Marcus Hoffmann wrote:
>> Hey,
>>
>> I just ran into an issue with the test-pkg script.
>> When the TOOLCHAINS_URL returns an unexpected result,
>> (A router login page, when the Internet got disconnected, a captive
>> portal login page, a MITM attack, etc.) the script does weird things and
>> outputs something like this:
>>
>>     html>: FAILED
>> <!DOCTYPE: FAILED
>>      HTML: FAILED
>>      HTML: ^[ORFAILED
>>      EN">:
>> [...]
>>
>> It also creates the corresponding folders inside the test-dir.
>>
>> You can test this when pointing the TOOLCHAINS_URL var to any html page.
>>
>> This it not a very nice way to fail and may lead to harm when parsing
>> untrusted input from the web.
>>
>> What would be the best way to handle this case? Can the Toolchain URL be
>> switched to https? This would eliminate the problem.
> 
>  I don't think a.b.o has https at the moment, though I guess it would be easy to
> add a Let's Encrypt certificate.
> 
>  Still, a captive portal with an accepted certificate could still play tricks.

But it wouldn't be valid for the buildroot url, so I don't think it can(?).

> It's probably better to validate the result.
> 
>  However, I think it would be much nicer if we could just have the toolchain
> defconfigs inside of Buildroot instead of using this CSV file.

I don't know how often they change, but if this makes sense this would
be a good solution I think.

> 
> 
>> Otherwise we should do some sanity checking that no stray html page is
>> returned by the curl call. But this still doesn't solve the problem of a
>> malicious actor.
> 
>  I don't think a malicious actor is really something we should worry about here,
> is it?

Probably not terribly so. But if we can easily solve such problems (have
them locally or pull over https) we should!

> 
>  Regards,
>  Arnout
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] test-pkg script can't handle captive portals. etc.
  2017-02-28 20:30 [Buildroot] test-pkg script can't handle captive portals. etc Marcus Hoffmann
  2017-03-01  8:46 ` Arnout Vandecappelle
@ 2017-03-01 20:06 ` Yann E. MORIN
  1 sibling, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2017-03-01 20:06 UTC (permalink / raw)
  To: buildroot

Marcus, All,

On 2017-02-28 21:30 +0100, Marcus Hoffmann spake thusly:
> I just ran into an issue with the test-pkg script.
> When the TOOLCHAINS_URL returns an unexpected result,
> (A router login page, when the Internet got disconnected, a captive
> portal login page, a MITM attack, etc.) the script does weird things and
> outputs something like this:
> 
>     html>: FAILED
> <!DOCTYPE: FAILED
>      HTML: FAILED
>      HTML: ^[ORFAILED
>      EN">:
> [...]

In this situation, I would think that curl will happily return
sucessfuly, so we would not have any hint that the download actually
failed.

For that we would have to inspect the output, and see if that looks like
an actual toolchain list.

I'll see if I can do something about it.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] test-pkg script can't handle captive portals. etc.
  2017-03-01  8:46 ` Arnout Vandecappelle
  2017-03-01 11:09   ` Marcus Hoffmann
@ 2017-03-01 20:32   ` Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2017-03-01 20:32 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 1 Mar 2017 09:46:28 +0100, Arnout Vandecappelle wrote:

>  However, I think it would be much nicer if we could just have the toolchain
> defconfigs inside of Buildroot instead of using this CSV file.

This would actually also solve the problem of having the autobuilders
test master/next/lts branches, since the toolchain defconfigs to test
would be part of Buildroot, and not part of buildroot-test.

There is still the problem of all the special "exclusions" encoded in
the autobuild-run script.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-01 20:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-28 20:30 [Buildroot] test-pkg script can't handle captive portals. etc Marcus Hoffmann
2017-03-01  8:46 ` Arnout Vandecappelle
2017-03-01 11:09   ` Marcus Hoffmann
2017-03-01 20:32   ` Thomas Petazzoni
2017-03-01 20:06 ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.