Better HN
topnewbestaskshowjobs
Log inSign up

codedokode

9,867 karma · joined Aug 20, 2015 (11y ago) · 5,528 submissions

PHP developer from Russia.
Submissions

comment 10y ago · link · parent

I see no problem with downloads. Saving a file can be implemented with a helper that has access to disk but doesn't have other permissions (like accessing the network). The path to save a file is chosen by a user.

The developers either care too much about compatibility with legacy software or just don't want to invest into implementing more secure environment. Patching existing software seems to be much cheaper.

comment 10y ago · link · parent

Something like this is built into Android and iPhone. As all major desktop OSes are only good in protecting one user from another mobile OSes run every application under its own user account. So vulnerability in an image viewer would not give an attacker access to other apps' data. But the system is not perfect, for example the kernel can still be attacked (and as we know a lot of vulnerabilities were found in Linux in recent years) and on Android the files on sdcard partition are not protected at all.

But desktop OSes don't do anything at all to protect the user. They allow the user to run a program by just clicking a link in email or web browser and this program has full access to all their data as does the PDF viewer or Java plugin in a browser. The desktop operating systems still use security models from mainframe era.

comment 10y ago · link · parent

There are ways to cache responses defined in HTTP standard since first version. No fancy HTML5 features is required for that.

(And if you meant using hashes to use cache for resources from different domains - there probably will be many misses because every website can use different library versions, they can compress or bundle libraries etc).

comment 10y ago · link · parent

jQuery is a large library. If it were modular and developers used only the code they need it would be faster to parse.

But I doubt the bottleneck is JS code. The problem is that web sites are not optimized (some frontend developers think that writing a CSS stylesheet for narrow screen is enough) and they include a lot of resources (including trackers, advertisement, spying social network buttons I never click). Some of the widgets create an iframe (which is like a separate tab in your browser) and load a separate copy of jQuery there, make AJAX requests etc. And even worse, some advertisement networks can create nested iframes 2 or 3 levels deep (for example when a network doesn't had own ads, they can put Google Adwords block). So when you load a page with 10 iframes it loads the CPU as 10 separate tabs.

Decoding images is not free too, especially if it is thousand pixel wide heavily compressed JPEG or PNG image.

The real optimization would be cutting away (or making lazily loadable by user request) everything except content. As website developers are not going to do it, it is better to do the optimization on client side. I wish standard mobile browser allowed disabling JS, web fonts (which are just a waste of bandwidth) and loading images on request. Mobile networks usually have high latency so reducing the number of requests needed to display a page could help a lot.

comment 10y ago · link · parent

> if you users have unreliable internet connections then a JS app can use a service worker to cache the entire app to work offline,

It looks like an over engineered system, and you have to preload the content while on WiFi. And by the way do you know a reliable way to detect whether device is really online or there is a link but no packets are going through?

And every website is supposed to write its own code for service worker.

I think it would be easier to implement a feature in a browser where user can explicitly save some pages for offline reading. Or allow user to view pages from cache.

> Sometimes JS does actually make a site better.

For most sites it just adds unnesessary widgets (like spying share buttons) and advertisements. Especially on newspapers' sites - most of them work better without JS.

comment 10y ago · link · parent

This just shows that password-based authorization doesn't work for normal (not computed engineers) people and needs to be replaced with physical cryptographic keys. This is a script kiddie level attack any teenager can do and it succeeded.

comment 10y ago · link · parent

Today the peering agreements are made so that ISPs get paid for whatever traffic they pass through. They have no financial motivation to change anything. And as the Internet is decentralized you cannot order them to do anything. So everyone has to protect from DDOS by themselves.

comment 10y ago · link · parent

Why rely on end devices? The infrastructure itself should be designed so that it cannot be broken that easily. Maybe we should return to metered connections, maybe we should implement a protocol to control routing.

The Internet has grown without proper planning using a lot of "quick and dirty" hacks (for example NATs, peering agreements) and today we just see the result. It reminds me of poorly designed email protocols that resulted in spam being the biggest part of email traffic.

comment 10y ago · link · parent

I think the main problem is that the Internet is decentralized. As it has no single owner nobody is responsible for mitigating the attacks and noone wants to pay for developing and implementing new protocols, installing new hardware.

comment 10y ago · link · parent

I remember reading the same about american submarines installing unknown devices on underwater cables.

comment 10y ago · link · parent

Would not disconnecting a cable from Russia or installing a firewall be a cheaper solution?

comment 10y ago · link · parent

Is it really important who wins it there are only two candidates that share common view on many problems? And you don't need Internet to count votes anyway.

comment 10y ago · link · parent

The fake login page still is not on a google domain.

comment 10y ago · link · parent

Those are script kiddie level phishing attacks. They use free domains and free link shorteners. Only a user that doesn't look at the address bar could buy that.

Is shows how insecure web is: a typical user cannot distinct between real and a fake login page. That is why we should stop using outdated insecure password system and switch to cryptographic USB tokens.

But Google usually blocks access to the account when you try to login from a new IP address. Why didn't it work here?

comment 10y ago · link · parent

You don't have to have a second phone (or even just a SIM card) with you, you can keep it at home.

comment 10y ago · link · parent

It probably depends on your IP address, country and maybe something else. Some time ago I was unable to register on youtube without providing a phone number, and earlier I have registered a Google Account from Android emulator that was instantly blocked. Maybe it is because of spam, or maybe because lot of people are using the same IP address.

comment 10y ago · link · parent

This is serious problem. In some banks having access to a phone allows the attacker to login into a web client and transfer money from the account. And many web services rely on SMS as a method to restore the password.

comment 10y ago · link · parent

In Chrome content scripts (the ones that are injected into a page from an extension) run in some kind of isolated mode: https://developer.chrome.com/extensions/content_scripts

Yet they have some privileges a normal script doesn't have, for example the ability to post messages to parent extension which can be exploited.

comment 10y ago · link · parent

Modifying DOM is not enough to cause a vulnerability. In Chrome content scripts (the ones that are injected into a page from an extension) have limited privileges though there still can be the ways to exploit them.

comment 10y ago · link · parent

The vulnerability occurs only if you inject Angular into a web page from browser extension in some browsers. There is no vulnerability if you are writing a SPA using Angular.

comment 10y ago · link · parent

You are making wrong conslusions.

> Angular v1 is dangerous thing by design

It is not dangerous. The vulnerability appears when incompetent developer injects Angular into a web page from a browser extension in Firefox (I don't know whether it would work in other browsers because they have other extension architecture).

comment 10y ago · link · parent

This "vulnerability" can be only exploited in specific cases when Angular is used in an unintended way - for example, injected in a web page from extension context in Firefox (which is wrong anyway because it would conflict with scripts on the page).

I tried to understand whether the same is possible in Chrome - injected scripts there have less privileges and use some form of isolation - but the manual [1] doesn't give a clear answer. The injected (and exploited) content script has lower privileges than an extension but has some API methods not available to scripts on a page. For example it can send messages to an extension and it could be exploited too.

But generally Chrome extension architecture provides more isolation and looks more secure especially when extensions are written by not very experienced developers.

[1] https://developer.chrome.com/extensions/content_scripts

UPD: Firefox uses the same security model for its web extensions as Chrome so both browsers are equally vulnerable.

comment 10y ago · link · parent

This "vulnerability" is harder to exploit in Chrome because extensions in Chrome (unlike in Firefox) have their own private DOM, and settings page have isolated DOM too. If an extension uses Angular only with its private DOM there is no vulnerability.

The vulnerability can be exploited only if an extension is running Angular on an untrusted page which is less likely in Chrome (but of course one should not underestimate the level of incompetency of a modern frontend developer).

UPD: @bzbarsky noted that Firefox is using the same security model as Chrome so both browser extensions can be vulnerable. To exploit a vulnerability, several conditions should be met: 1) extension should inject Angular into a web page 2) attacker should be able to find a way to get from content script context into extension's background page context.

comment 10y ago · link · parent

You can find same kind of "vulnerability" in jQuery:

    $(element).html(user input);
This will evaluate scripts in "user input". Does this mean jQuery is vulnerable? No, it just means you are doing something wrong with it.

UPD: I was wrong, jQuery inserts a script tag into DOM instead of directly calling eval() so the code above is not equivalent to eval and is another type of vulnerability.

comment 10y ago · link · parent

Don't extensions have their own DOM (like they have in Chrome)? Why would anyone run Angular on a browser page? It would probably conflict with existing application.

It looks like Firefox extension architecture has design problems.

And I don't like the presentation. One could think that Angular is vulnerable which is not true. The vulnerability appears when it is used in a wrong way in a browser extension.

comment 10y ago · link · parent

Of course that is wrong. Sadly if he was really murdered by government agents and even if they were caught they probably would not serve the full sentence and would be exchanged for some British spy.

comment 10y ago · link · parent

If you want to build an analogy the display of power by Russia would be if it requested to extradite Litvinenko for trial and UK would comply (I don't know if they tried to do it).

> But they can. They need preexisting extradition agreements and it's all good.

Then let's wait to see whether muslim countries can make such treaties and start judging westerners posting inappropriate jokes about Allah on Facebook. Such practice will just lead to a situation when international travel will become too dangerous and you'll have to consult a lawyer before going abroad.

comment 10y ago · link · parent

From a point of view of victim I see no big difference between actions of nation state or a criminal. Should not they be treated equally?

comment 10y ago · link · parent

The problem here is that it is US who decides whether a foreign person is a criminal or not. The laws can be different in different countries and as I wrote above, posting a picture of Allah can be legal in one country and a serious crime in another. People even were killed for publishing such pictures.

comment 10y ago · link · parent

> But to allow anyone to hack computer systems in the US because that person is not a US citizen and not in the US is borderline laughable.

NSA does hacking every day so can other countries extradite and prosecute its employees?

1
178179180
185