Readit News logoReadit News
dgl · 4 years ago
Remember with this kind of thing you're trusting the remote site with access to your terminal emulator. There have been various security problems with some more advanced terminals and escape sequences in the past[1][2].

Personally I think it's a cute thing and have implemented some similar little easter eggs to this via: curl ip.wtf/moo

[1]: https://blog.mozilla.org/security/2019/10/09/iterm2-critical... [2]: https://packetstormsecurity.com/files/162621/rxvt-2.7.0-rxvt...

xyzzy_plugh · 4 years ago
This is true of anything that ever renders to your terminal. I'm not sure this class of issue is worth worrying about, generally. Sure, these are neat and scary examples. Have you seen some of the recent GPU driver ACEs? Better not render any graphics!

A generalization of this is "receiving information from third parties can lead to security issues" which is of course true. Untrusted inputs are always untrusted.

Piping curl into bash is one thing, but this is on the level of "are you sure you want to open this file downloaded off the internet?" prompts of yore -- it's not productive.

treve · 4 years ago
Completely agree, but also I remember that 'piping curl into bash' was always one of the biggest no-no's. I held onto this for so long, but then realized every time I run 'npm i' arbitrary commands can also run, and now it seems wild that I ever cared about curl | bash on websites that I trust
spoils19 · 4 years ago
> Better not render any graphics!

Unironically a good idea. Graphics have always been a mistake - most engineers would agree that if we stuck with very basic output, our software would be in a much better place than today (and more usable, too!)

usr1106 · 4 years ago
If you have a vulnerable terminal emulator, yes. Well, the same holds for every web site you visit if you have a vulnerable browser.
usr1106 · 4 years ago
Unless there were an escape sequence meaning "execute this". I am not aware such beast would exist.
thehappypm · 4 years ago
Is curl unsafe? This is a pretty basic invocation of curl, no fancy flags needed.
junon · 4 years ago
Curl isn't the problem they're describing. The remote can assume you're running it in a terminal (especially since the user agent string indicates you're using curl) and can send malicious escape sequences in the body, which will be interpreted by your terminal emulator in most cases.

This is true of any program that prints output directly from a remote host / untrusted source.

In the event your terminal emulator has a vulnerability or allows you to run arbitrary commands (this is a feature of some emulators), the site can target that functionality for users of that emulator and wreak havoc.

I maintain a lot of ANSI escape related code. These exploits have always been theorized, but I've not once heard about this being exploited in the wild. It's certainly possible. Not very probable. Refer to your threat model, as always.

tlamponi · 4 years ago
No it isn't, or it's at least not the problematic part. curl is just the messenger, and on outputting things to a terminal you can use escape codes, and other things, to do some funky stuff like changing colors or making text blink.

If the terminal has a bug w.r.t. something it processes one could leverage that, but they'd probably need to know which terminal and maybe even which shell you're using; so maybe don't let curl/wget but also `cat` of a downloaded file output directly to the terminal if it isn't a trusted origin or if it looks/feels shady.

mateo1 · 4 years ago
I'm speechless. I never expected running curl could lead to such a security disaster.
nickstinemates · 4 years ago
`sudo curl | sh` to deploy my awesome service that definitely isn't a bitcoin miner, promise.
daptaq · 4 years ago
The terminal (or rather terminal emulation) is a mistake, people should stop glorifying it. It has no inherent value, beyond being able to run historical software that was bound to a terminal. Most of all one should stop confusing the terminal and the shell, which remains an interesting concept.
behnamoh · 4 years ago
which begs the quotation: is there such a thing as a “firewall” for terminals?

my idea is to limit the terminal’s cpu usage so that any breach does not spread quickly in the system, and maybe limit the terminal’s network access, but leave the shell out of it. idk if the last part is possible.

dredmorbius · 4 years ago
ObLogicalFallaciesNit: It raises the question.

Begging the question is to answer the question with a premise that assumes the result. It's a form of circular reasoning.

https://www.thoughtco.com/what-is-begging-the-question-falla...

https://www.writersdigest.com/write-better-fiction/begging-t...

And to be clear, your question is a good one. It's just that it's raised and not begged. That said, I see and hear this all the time, including by historians of philosophy who are strongly familiar with logical fallacies and their distinctions.

dgl · 4 years ago
I think that is probably excessive, a terminal is hardly as complex as a web browser.

screen or tmux (or even mosh) can essentially act as a terminal firewall, as they interpret escape sequences and maintain a virtual “screen”. Then you can sandbox their process in docker or similar.

Or if you want web browser style sandboxing maybe just using Xterm.js could work.

texaslonghorn5 · 4 years ago
Run it in a container?
nooyurrsdey · 4 years ago
Only HN can be so critical of what is a really cool project.

Honestly this is a great _simple_ way to access weather without leaving my terminal. Love the basic ASCII graphics.

I noticed it's a LOT faster when I provide the city, probably because it doesn't have to look it up from IP:

``` curl wttr.in/atlanta ```

Nice work.

mekster · 4 years ago
It's just cool but practically I never check weather until I'm about to leave home and then I'll just check a local weather app on my phone which should give more accurate and detailed info than a service that covers the entire world with presumably varying degree of accuracy.
nickstinemates · 4 years ago
but imagine if you're in a bunker hacking on your fav project, no artificial light and you wonder.. shall i go to the surface? you curl this website and, if tolerable weather conditions, you plan your ascent.
NmAmDa · 4 years ago
People on HN should he normally worried about running 'curl' from any untrustworthy sources because that is a security issue.

An example -https://www.onsecurity.io/blog/careless-with-curl-dont-be/ -

galenguyer · 4 years ago
This talks about concerns with piping curl into bash. It doesn't address any issues with just curling arbitrary data
innocenat · 4 years ago
I have to scroll all they way down to the buttom to find the information source -- WorldWeatherOnline. Does people not care about where their whether data is sourced from?

Living in Japan, I have always been wary of these type of service, since I find a lot of them really inaccurate. And I just checked, Tokyo show 15C on that website, while high resolution current weather information from Japan Metrological Agency show 18C.

cmeacham98 · 4 years ago
I'll admit I'm just speculating because I don't know much about weather and weather data collection, but is it not possible there's a 3 degree difference between 2 different places of measurement in Tokyo (i.e. both are correct to some degree?)
_moof · 4 years ago
> is it not possible there's a 3 degree difference between 2 different places of measurement in Tokyo

I don't know about Tokyo in particular, but generally speaking, for a large coastal city that wouldn't surprise me at all.

teaearlgraycold · 4 years ago
> while high resolution current weather information from Japan Metrological Agency

They are complaining about location precision. It might be very coarse (equivalent to US zip code size). It’s a valid complaint. I use Dark Sky on iOS because it’s accurate to 10 meters or so.

innocenat · 4 years ago
I checked about dozen station in Tokyo and they were the same.
is_true · 4 years ago
I think you are comparing a weather model with the current reading from a weather station.
innocenat · 4 years ago
So you are saying that "weather right now" shouldn't be a reading from weather station?
usr1106 · 4 years ago
I agree. I always avoid these aggregators that offer world-wide coverage. The quality of the data is often questionable.

As a cyclist I'm mostly interested in rain. So I check the rain radar of the national weather service, which has excellent resolution.

Even when travelling I spend 5 minutes to dig out the relevant local pages of a national weather service and bookmark them. Not something I have to do so frequently that any kind of automation would be needed.

Weather apps and this client are a solutions in search of a real problem. Yes, it's a nice demo, I like working with the terminal. But I am not working with weather all day long.

LeoPanthera · 4 years ago
This is why I like Windy.com. They give you the output directly from the various weather models and you can actually see them all in parallel or just pick whichever one works best for your location.
brewdad · 4 years ago
Living in the PNW where predicting snowfall can be problematic to say the least, I love looking at the various windy.com models. One particular storm, that lead to about an inch of sticking snow this past winter had ranges from 2-20 inches predicted by the various models. The worst part is the 2 inch prediction came from the model that is generally considered the least reliable for our area.
timonoko · 4 years ago
Seems to be mostly Airport data. Helsinki Airport is not in Helsinki, so this information is quite useless. Also we do not measure windspeed in km/h.
yxhuvud · 4 years ago
Windspeed unit was configurable though.
e-dant · 4 years ago
Metrological?
avgcorrection · 4 years ago
> Does people not care about where their whether data is sourced from?

Weather or not I care is really not your concern.

yasenn · 4 years ago
Igor created several great cli projects like cheat.sh[1], late.nz[2], QRenco.de[3],rate.sx[4]

Also, he maintains the awesome-console-services[5] list

[1] https://github.com/chubin/cheat.sh

[2] https://github.com/chubin/late.nz

[3] https://github.com/chubin/qrenco.de

[4] https://github.com/chubin/rate.sx

[5] https://github.com/chubin/awesome-console-services

cercatrova · 4 years ago
More cool console services like this one: https://github.com/chubin/awesome-console-services

  curl wttr.in/Moon
Shows moon phases

  curl rate.sx
Shows cryptocurrency exchange rates, from the same author as wttr.in

I sourced the above commands from a previous HN post: https://news.ycombinator.com/item?id=23646953

nickstinemates · 4 years ago
rate.sx is very good. much better than all of the desktop client trackers out there and the web ones with too much granularity. sometimes i don't want to see the candles i just want to see the price of a particular coin
granddave · 4 years ago
This is a really nice service and I have used it for quite some time. Just a small reminder; to relieve the wttr servers, please cache the results on disk if you for example want to have a higher refresh rate on your tmux status bar.

See my dotfiles repo [1] if you're interested in such implementation

[1] https://github.com/Granddave/dotfiles/tree/master/tmux

sigg3 · 4 years ago
I'm going to add that if you live in Norway, YR has nice weather data available for free (required by law). Shameless plug for my little CLI tool when I was beginning to learn go:

https://github.com/sigg3/weather_query/

nickjj · 4 years ago
I've had this shell function / alias set up for years:

    weather () {
        curl "https://wttr.in/${1}"
    }

This lets you run: weather nyc, a zip code and everything else wttr.in supports.