Slashdot Mirror


Security Software Conflicts with AJAX?

ithyus needs help with the following: "My employer is running an e-commerce site that, until recently, our customers were quite happy to use. With increased traffic to the site we decided to implement AJAX to try to reduce the load on our database servers. In doing so, our customers have experienced all kinds of problems with security/privacy software such as Norton and McAfee. It seems that no matter what we do we can't make these programs happy. Bigger companies such as Google have documented work arounds for some of them, but we wouldn't be able to keep our docs current with all the software that's presently out there. I'd really like to know how Slashdot's readers have handled these issues. Since security programs don't appear to be compatible with the emerging features of the Internet, do you simply suggest that the customer disable the offending software or do you opt to offer some support for the more popular ones? Are those really the only two options? How do you justify your method?"

84 comments

  1. Generally, you work around the user's environment by Metasquares · · Score: 1, Interesting

    In general, you want to work around users' environments, not the other way around. That means if something you're using isn't compatible with a large number of your visitors' systems, you either work around it or use something else. Then your justification becomes "because it works". If you tell everyone to uninstall their antivirus software to use your site, I suspect you'll lose a substantial number of visitors.

    If you're resorting to using AJAX only ameliorate your DB load, you may wish to try more conservative methods that will work on all client machines, such as optimizing your queries, first.

  2. Answered Own Question? by conJunk · · Score: 3, Insightful

    ummm.... You answered your own question, didn't you? The like to Google's "work arounds" seems to be the answer. These aren't work arounds, they're specific steps for authorizing your site with the AV software. Just make your own document similar to google's and direct customers to it.

  3. Eh? by cjsnell · · Score: 1

    Explain to me how creating more HTTP requests by using AJAX is going to decrease your database load.

    Oh, while we're at it, explain how sheep's bladders may be employed to prevent earthquakes.

    1. Re:Eh? by notAyank · · Score: 1

      I don't use ajax, but I'm guessing the logic goes somewhat along the lines of this: A page refresh to update a single control might require 5 database queries in order to completely populate the page's controls, whilst an ajax request to update a single control requires 1.

    2. Re:Eh? by cheezit · · Score: 1

      Yes, it's very cool. AJAX prepopulates all data required for all possible actions on the page, saving round trips to the server. The fact that the user will only perform one of those N actions, and all the other data is thrown away, is a minor detail.

      Those AJAX-bashers don't seem to understand that web servers don't scale horizontally, whereas database servers can be scaled by throwing more cheap boxes in the data center. And we live in a strange world where delivering a single huge page is faster than several small ones. Luckily AJAX gives us something other than an hourglass to watch while it loads. Like an ad! Or maybe a "loading" status bar, implemented in some kinda DHTML/CSS/XML/dog food, natch!

      --
      Premature optimization is the root of all evil
    3. Re:Eh? by Bogtha · · Score: 5, Informative

      Explain to me how creating more HTTP requests by using AJAX is going to decrease your database load.

      Simple. Let's take Slashdot moderation as an example. Last time I saw it, it included a drop-down for each comment, and the ability to submit your moderation for all comments. When the form is submitted, the user-agent transmits the moderation status for each comment to the server, and reloads the entire page. This entails not only wasting bandwidth (by transmitting all comment statuses instead of only those that have been altered), but also a high cost because even if you only moderate one comment, a page with potentially hundreds of comments has to be sent back to you.

      A moderation system that uses Ajax to submit comments, on the other hand, sends only one status for only one comment, and doesn't have to reload the page with hundreds of comments, because all it needs is a simple success or failure flag in return. Thus, if you moderate five comments, you might make five requests, but those requests are tiny compared with the single massive request that the non-Ajax version needs to make.

      In the more general case, it may very well be that some database queries simply don't need to be made in most cases, but do in a minority of cases upon certain user interactions. In these cases, without Ajax, you are stuck performing the queries preemptively for all users, instead of only in the minority of cases where it is needed.

      Thinking "more HTTP queries == worse performance" is an incredibly superficial analysis and neglects many important factors.

      --
      Bogtha Bogtha Bogtha
    4. Re:Eh? by CerebusUS · · Score: 1

      How about this:

      A shopping cart application where everything but the price and inventory levels are cached out to the web servers as static content. Then a small piece of javascript goes and pulls the inventory and the price and feeds them to the controls on the page.

      Before AJAX, the entire page would be dynamically generated, meaning the database would have to supply the product description and all other content on the page. Now that information can reside in the database, but the app server first looks to it's local cache and serves that if it's available.

      You reduce your database load _and_ your app server load, as delivering static html is the easiest on the webserver and can be scaled out to other load balancing devices as well.

    5. Re:Eh? by Mr+Z · · Score: 1

      Thank you. At the same time, background refreshes when the user isn't paying attention, such as GMail or the Yahoo Beta do, could generate many queries that the user will never notice but the DB has to endure. There needs to be a way to prioritize background activity over direct UI interactions, and/or optimize the server for these background refreshes. Random idea: You could have the server generate a parallel disposable mini-database of "things that have changed since the currently active sessions last refreshed." If a session ever appears bogus or lasts "too long," you can nuke its rows in this cache DB and do the full query in the main DB.

      --Joe
    6. Re:Eh? by GoRK · · Score: 2, Informative

      The cost of reloading some or all of a webpage (outside of the obvious bandwidth needed) depend a great deal on the way the application is coded.

      In GMail for instance, it would make sense for open sessions to not query the users mailbox each time the requestor wants a list of (new) messages, but to move to an approach where a new message being delivered to the mailbox notifies the session that there is a new message. I really see no reason that GMail should be querying for the list of messages more than once after login. The data should be brought up from the archive to a faster access medium such as a distributed memory cache, sorted, indexed, and served from there. If the dataset does not undergo any significant changes, the last copy generated is still current and can be recycled with bare minimum overhead. Changes to the data should be performed to the in-memory version and backgrounded to the real database. Unfortunately the approach of 'put it into the database when it comes in'; 'get it out of the database every time you need it' when there are no strict transactional requirements is very often an extremely poor way to code high performance web applications and there are a great many large website engines that are unfortunately coded this way. Every time I see a 'slashdotted' site that is throwing database errors yet serving essentially static content I abandon all hope. This is particularly true when the site in question is supposed to be hosting an article about how to increase server performance, implement coding best practices, optimize web applications, etc.

    7. Re:Eh? by Mr+Z · · Score: 1

      Disclaimer: I am not a database expert. :-)

      This is why I mentioned the "session cache" idea. Once the server farm knows a session is active, any transactions that come in that modify the state the session might be interested in can go to a separate "things that happened since you last asked" database. That database can be really small, and discarded when convenient. The cost of discarding it is that you need to do a full query on the main database.

      With this sort of approach, you can stick to a client-pull model, which as I understand it remains at the heart of AJAX. The server isn't notifying the client of changes, but rather the client connects periodically and asks "What's new?"

      Am I wrong in thinking that's the model? (I'm truly curious, not as a web developer, but rather as a memory system architect. Similar problems come up in both spaces, though your latencies are measured in seconds and milliseconds, whereas ours are measured in microseconds and nanoseconds.)

      --Joe
    8. Re:Eh? by Thundersnatch · · Score: 1

      Many web-based applications already do something better; my employer owns at least one.

      The basic technique is to create a derived database access class(es) that include simple caching logic. The whole app then uses that derived class for DB access.

      When the cache-aware class(es) are used, the developer indicates whether or not cached data is desiered, and optionally what the specific timeout should be. When a call to this "caching DB class" is made, the SQL that would be sent to the database is instead first hashed, and compared with the cache. If there is a match, and the cache timeout has not been exceeded, the data is returned directly from the cache, otherwise it is passed on to the DB and the result is cached.

      Of course, the dev can always specify a query as not cacheable for transactional data, but common things like drop-downs and permissions look ups are quickly cached by this automatic mechanism. When our vendor implemented similar caching in their app, it reduced the average CPU utilization on our DB server by 40%, and made a noticeable improvement in end-user response times. And the amount of code they needed to change was very small; they only had to add 'cache=YES' to the DB access code in a very few critical areas of the application. But the key is that the whole app is still database driven: there are no static files to update when items like menus change.

    9. Re:Eh? by Anonymous Coward · · Score: 0

      You really have no idea what you're talking about, do you?

    10. Re:Eh? by Anonymous Coward · · Score: 0

      I am not an AJAX expert, but I don't believe you can set it to "listen" for periodic connections from the server. HTTP is only a client pull model, so you have to stick to that anyways.

      It's been 5 minutes since you last successfully posted a comment

      (Slashdot: Still broken, but now with a new look!)

    11. Re:Eh? by nicolaiplum · · Score: 1

      That's basically wrong.
      It's easy to scale web servers by adding more of them, with a load-balancer (such as a Cisco CSS, and/or a software layer like mod_jk) to distribute requests appropriate.
      It's hard to scale a database, especially one that gets updated, because distributed writable databases are hard to do, and even distributed read-only replicas get tricky, especially if they must be up to date.
      In any web services application you really want to avoid hitting the database if you can, by using simple data caching, client-side intelligence like AJAX, server-side session caching, etc.

      --
      "For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled"
    12. Re:Eh? by unity100 · · Score: 1

      What happens to the piled up requests if you get a connectivity loss or something ? Discarded ?

    13. Re:Eh? by kalirion · · Score: 1

      Yes, it's very cool. AJAX prepopulates all data required for all possible actions on the page, saving round trips to the server. The fact that the user will only perform one of those N actions, and all the other data is thrown away, is a minor detail.

      Does everyone really wear goatees in your dimension?

    14. Re:Eh? by CerebusUS · · Score: 1

      Sounds like a very cool implementation. The primary driver for us was applications that on average don't see very much usage, but on certain days can see that usage spike by up to 1000-2000% (think registration-type stuff)

      So the site tends to be fairly static by the time of the crush, but we need to serve as many pages as possible in a matter of 5-10 minutes. For us, static html with only a few of the pages making any db calls at all allowed us to handle the crush and scale amazingly well.

      The diversity of possible solutions a given problem is one of the things I really like about this industry :-)

    15. Re:Eh? by cheezit · · Score: 1

      No, I have no idea! And apparently you are not aware of the satirical technique of stating the *opposite* of what one really thinks, creating a humorous juxtaposition. "Dog food"? My comedic talents are wasted on you ignoramuses!

      --
      Premature optimization is the root of all evil
    16. Re:Eh? by cheezit · · Score: 1

      It's funny how what I said was pretty much the inverse of what is correct, huh?

      --
      Premature optimization is the root of all evil
    17. Re:Eh? by cheezit · · Score: 1

      We call them "sheepees."

      --
      Premature optimization is the root of all evil
    18. Re:Eh? by GoRK · · Score: 1

      Well you can sort of fake a push model with AJAX in that you can have the server start sending data that is processed as it comes in 'live' without having to continually request updates. This is often the type of thing that is done (and is favorible) with file upload progress bars, chat applications, and the like. The session cache is the right idea, yes, except generally it doesn't really have to be a full database. Depending on the application, data may be copied to a database table stored in RAM or seperately cached to disk or even put into something like memcached (a network distributed RAM cache). In any case, there would be a locking mechanism on this data so that not only could the user (requesting webpages) alter it but so could other processes such as a message delivery agent in a mail system or other users in a chat application, a database trigger, etc. Continually having the client make requests would create overhead in setting up the connections everytime and reopening the user's session data, but whether or not you are doing something that is polled like this or pushed, you get the benefit of not having to wait on the database in either case.

    19. Re:Eh? by budgenator · · Score: 1

      why not just use some javascript and only submit changed values. That means a max if 5 key/value pairs per page; at least for most user who don't use lynx or w3m.

      --
      Apocalypse Cancelled, Sorry, No Ticket Refunds
    20. Re:Eh? by budgenator · · Score: 1

      maybe he doesn't have to add a distributed database; adding a database server to host the autherization system tables on one machine, maybe another to serve the read-mostly tables, and if they need it a third for the Read Write workhourse tables like orders and inventory. That way he could even pick and choose the database servers individualy on their particular strengths and weaknesses. There have been times when I've done that by accident which makes bug-bashing interesting.

      Maybe the real question should have been, our site's database is dragging ass, how do I find out which database queries are sucking canal water so I can optimse them or move them to a dedicated server?

      --
      Apocalypse Cancelled, Sorry, No Ticket Refunds
    21. Re:Eh? by Fulcrum+of+Evil · · Score: 1

      database servers can be scaled by throwing more cheap boxes in the data center.

      HAHAHAHAHAHAHA!

      Sorry, it's just that when you sai... HAHAHAHHAHA!

      Umm, yeah, what was I saying?. Oh yeah: databases don't scale horizontally, and Oracle clusters are a pain in the ass. You could always do some sort of caching to unload the db, but AJAX is good for improving percieved interactivity.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    22. Re:Eh? by Fulcrum+of+Evil · · Score: 1

      but also a high cost because even if you only moderate one comment, a page with potentially hundreds of comments has to be sent back to you.

      Which shouldn't actually hit the database - maintain an lru cache of all stories with a size of around 50 and an expiry of about 1 minute. Each box that holds this cache loads a list of comments once per story per minute at most. run four or five instances of the cache and point the webservers at it - presto! no slammed database.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
  4. try memcache? by Anonymous Coward · · Score: 0

    I can see how ajax would lighten the load to some extent but wouldn't using memcache be more appropriate?

  5. No way out by unity100 · · Score: 0, Redundant

    First, Ajax is not going to reduce your database load, if you do not use it like a cache for already performed query results in remote client pc. And even in that case, if you use query caching (in mysql for example), as most common queries will have been already cached, they wouldnt incur as much load as they would as they will be pulled out of the cache without an extra new query. Even if you go for "using as a cache to store the content in remote client pc" route, than there is the matter of uploading loads of content that many clients will not be even attempting to view, and in congested network routes your site might seem as being slow to come up.

    As for security matter, there is indeed no way out i believe :

    You, no matter what you use, are utilizing a remote processing power in a remote pc to process the content. That is actual compilaton of some sort of code to do something, and that is not just getting a plain text format html code and visually putting it in place.

    As we have experienced that even images can be used to embed viruses, it is no joke or no surprise that there will come up viruses/exploits that are going to use such and such procedures of Ajax in ways unimaginable now to do mischief. Java is already something that the anti-virus guys and people are wary about, it is widely exploited to plant a phletora of stuff in visitor pcs. Just type "porn" to google, and visit the 10 sites that come up, or go deeper from a link, and voila, an example for the above situation.

    Anti virus is never going to be easy and happy with ajax, that is for sure.

    Anything that takes the work to client pcs can be exploited for mischief.

    1. Re:No way out by bobsledbob · · Score: 1

      Java is already something that the anti-virus guys and people are wary about, it is widely exploited to plant a phletora of stuff in visitor pcs.

      I'm somewhat arguing with this point, but also legitimately curious. There are really only a few very insignificant examples of Java applet based virus, all of which use outdated JVM. Your statements make it sound otherwise. Do you have proof of "widely exploited" holes in the Java sandbox?? I doubt it, but I'd appreciate being proven wrong otherwise.

      For stand alone Java applications, yes there are exploits. This is no different an issue than running any *.exe program. But, it seems like you're only addressing sandboxed applets.

      --
      Beware of geeks bearing formulas.
    2. Re:No way out by ampathee · · Score: 1

      I think he meant JavaScript.

    3. Re:No way out by unity100 · · Score: 1

      Nay exploit there is not in the technical meaning as we know it - ie usage of holes and bugs to accomplish something. I told it as it is in dictionary meaning.

      I was referring to planting of trojans, viruses, etc to clients' pc through using legitimate commands and routines. Ie like in many porn sites. - 5 Popup windows open, they spawn another 10 popup window and redirect to another 5, and despite youre loaded with patches, zonealarm, karspersky anti vir, closed dcom, and so on, you get infected.

    4. Re:No way out by unity100 · · Score: 1

      Yea this is correct, i meant javascript. Late was the hour of my posting. http://ask.slashdot.org/comments.pl?cid=15476737

  6. Re:what are the specific problems? by larry+bagina · · Score: 1

    McAffee silently works as a proxy and adds javascript to downloaded pages -- an error handler to prevent javascript errors, maybe some other things as well.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  7. If it isn't broke... by Anonymous Coward · · Score: 0

    ...don't fix it!

  8. HTTP Rewritten by Anonymous Coward · · Score: 1

    I believe before AJAX should be fully deployed, HTTP will need to be rewritten to allow much more streamlined updating. I would also have a look at Norton and other virus detectors. I use AVG, but asking your clients to use another software isn't feasible. Is it possible to go back to the old way? If it isn't broken, I wouldn't fix it. I have read some topics from message board software deploying AJAX techniques and some large forums turn off many of the AJAX features because it just isn't resource savvy.

    1. Re:HTTP Rewritten by Baron+von+Leezard · · Score: 1

      Already done and fully deployed: HTTP 1.1 includes persistent HTTP connections and pipelining of requests within the same TCP session. This means that the common conception of how HTTP actually functions—i.e. one TCP setup/teardown per HTTP request—is just incorrect. Of course, this depends on both ends of the connections supporting persistent connections and having the option to use them turned on.

      [B.v.L]

  9. Re:what are the specific problems? by generic-man · · Score: 1

    In the past I've seen problems that arise when Norton, McAfee, etc., block the referer* header in the name of security. Although it provides a modest gain in privacy, many sites use the referer header to make sure you're not using their form submission interfaces, images, and other data for third-party purposes. I had to work around it by modifying my referer-checks to include a check for a NULL referer.

    (Yes, referers can be spoofed and needn't be specified in HTTP, but every browser sends them by default.)

    * "Referrer" in English, but "referer" in HTTP.

    --
    For more information, click here.
  10. Don't ask customers to be vulnerable by Siergen · · Score: 3, Insightful

    Over the years I have had 3 on-line merchants ask me to disable or uninstall my network security software to access their site. I immediately stopped shopping at each of them. They were not selling anything worth the risk of being connected to the Internet with no protection, and I doubt that you are selling anything worth that risk either...

    1. Re:Don't ask customers to be vulnerable by nicolaiplum · · Score: 1

      On the other side, obviously your "network security software" was always correctly written and configured, by people who understand the subtleties of how all the common network protocols work?

      --
      "For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled"
    2. Re:Don't ask customers to be vulnerable by From+A+Far+Away+Land · · Score: 1

      Some customers are MORE vulnerable because they use McAfee or Norton. They either don't realize that their subscription is expired, they expect protection from obvious emailed viruses that slip past the scanner, or the scanner itself introduces a critical flaw in the system like Symantec often does. Not a year goes by without a critial Symantec security software flaw.

      I'm not saying that telling a customer to uninstall or disable Norton is the right way, but there are worse things you could do.

  11. You know... by NeoThermic · · Score: 4, Insightful

    There is a quick and simple answer to this one. Detect if the AJAX is not working (or let the user specifiy they do not wish to use AJAX), and send a document that can do the same end results as the AJAX version, but (and wait for it), without AJAX.

    If you are designing programs that can be potentially used by many thousands of users, you can not afford to write programs that only cater for those who wish to play by *your* game. A good few of them will refuse and use another software.

    NeoThermic

    --
    Use my link above, or to view my server, NeoThermic.com
    1. Re:You know... by John+Courtland · · Score: 1

      Yeah, I do this. While it adds a small level of complexity and a tiny extra hit at the initial page load, you can save the status of that in the session and send pages accordingly.

      --
      Slashdot is proof that Sturgeon's Law applies to mankind.
  12. Haven't run across this yet by spyrral · · Score: 2, Interesting

    And as a web developer that tries to make good use of ajax style techniques, this is very troubling.

    I'm always seeing articles about AJAX security issues, and they always puzzle me. AJAX is just another way of sending http requests to the server from the browser. If you're able to write secure server side scripts already, then you should have no trouble writing ajax responders. How do these security aps decide that these particular http requests from the browser are "bad"?

    1. Re:Haven't run across this yet by petermgreen · · Score: 2, Informative

      i'd guess most likely they are completely disabling activex in IE

      IE only supports AJAX through activex (this is changing in version 7 but that won't be widely deployed for a while).

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    2. Re:Haven't run across this yet by GoRK · · Score: 2, Insightful

      You said it yourself:

      AJAX is just another way of sending http requests to the server from the browser.

      Unfortunately this alternate method makes use of a couple of potentially harmful mechanisms: client side scripting and (in IE) ActiveX. Additionally, it is not uncommon to see AJAX requests and responders bend or break the rules of HTTP also which can cause packet-inspecting firewalls some grief. Sure, you can easily code up a little shopping site where you click 'show price' to load the price via AJAX, but it's no excuse for not making that same link do the right thing in browsers that do not have that capability.

    3. Re:Haven't run across this yet by aminorex · · Score: 2, Funny

      You're telling me that IE's XHR violates the HTTP protocol? I'm shocked, sir!

      --
      -I like my women like I like my tea: green-
    4. Re:Haven't run across this yet by LDoggg_ · · Score: 1

      Can you explain this:

      Additionally, it is not uncommon to see AJAX requests and responders bend or break the rules of HTTP also which can cause packet-inspecting firewalls some grief.

      I can see XMLHttprequest breaking HTML data(as in using XML and parsed/rendered through javascript as opposed to preformatted HTML), but HTTP? How?

      The same headers are sent as though you're doing an regular GET by typing a URL in the browser, therefore sessions,cookies,authentication/authorization, etc. remains the same.
      If your firewall is choking on it, its because its trying to parse an HTML document for bad or naughty text when that text could be in whatever xml schema the website author chooses. Packet inspection failing on xml should be considered a fault of the packet inspecting software.
      The XMLHttprequest is operating in a sandbox much like java applets. So far I've only managed to see people screaming FUD about security issues, because they are trying to sell an "enterprise" solution or services.

      Sure, you can easily code up a little shopping site where you click 'show price' to load the price via AJAX, but it's no excuse for not making that same link do the right thing in browsers that do not have that capability.

      I agree with that line 100%, but the use of AJAX as an enhancement to the shopping cart does not inherently bring up security issues.

      --

      "If they have both, tell them we use Linux. And if they have that, tell them the computers are down." -Dave Chapelle
    5. Re:Haven't run across this yet by GoRK · · Score: 1

      The same headers are sent as though you're doing an regular GET by typing a URL in the browser...

      That all depends on how the application is written, doesn't it? I can hook into Apache and make it violate any part of HTTP that I want to with little effort. As hard as it might be to believe that programmers sometimes take shortcuts, when coding these thin AJAX responders, some authors do actually neglect to send proper headers or any headers at all! Shockingly, some even neglect to send XML entirely!

      The XMLHttprequest is operating in a sandbox much like java applets.

      By "is operating" I assume you really mean "supposed to be operating". In any case it is the browser's fault if there is a security problem, so it's not like a developer should run away just because of the possibility of an exploit; if people thought like that, who would even use computers?

      I agree with that line 100%, but the use of AJAX as an enhancement to the shopping cart does not inherently bring up security issues.

      I didn't say it does; but it imposes requirements of the browser that some administrators and some security software have chosen to lock down because of the mere possibilities of security problems; therefore an application's behavior should degrade gracefully when these features are not present. Bad practices with AJAX techniques really ought to create nothing more than a support problem and proper use should not create any problems at all.

    6. Re:Haven't run across this yet by LDoggg_ · · Score: 1

      That all depends on how the application is written, doesn't it?

      Not really. The web app developer can only assume that AJAX HTTP requests are following the rules, and as such security on the server side is important which it should be regardless of issued the http request in the first place.

      Shockingly, some even neglect to send XML entirely!

      XML isn't really a requirment, you could use JSON, or even preformatted HTML if you'd like, but you'd lose the built in DOM parser that most javascript interpreters use these days. Also you might lose out on a potential bandwith savings if your xml schema is small with only relevant data is pulled down and formatted on the client side.

      By "is operating" I assume you really mean "supposed to be operating". In any case it is the browser's fault if there is a security problem, so it's not like a developer should run away just because of the possibility of an exploit; if people thought like that, who would even use computers?

      That's a little nitpicky isn't it? You build an application so that no what matter malformed request comes through it doesn't harm the server side. If you don't feel that the xmlhttprequest implementation is sloppy on your browser, that browser shouldn't be used. Ajax is helpful in many situations, just turning it off is burying your head in the sand.

      --

      "If they have both, tell them we use Linux. And if they have that, tell them the computers are down." -Dave Chapelle
  13. Graceful degradation usually fixes this by Bogtha · · Score: 4, Insightful

    The kinds of things security software disables should be non-essential anyway. For instance, ActiveX disabled in Internet Explorer will stop you from using XMLHttpRequest, but that throws an error that you can catch, and your fallback behaviour for non-JavaScript users can be used.

    Whenever I see somebody complaining about software interference with web applications, it's virtually always because they've cut corners and neglected to code appropriate fallback behaviour when browsers don't support a particular feature. Unfortunately, it's impossible to give you specific advice because you've unhelpfully neglected to mention anything specific at all about the problems you are having.

    As somebody else mentioned, if your goal is to reduce load on your databases, then this can be achieved through other means. For instance, caching (both page fragments, and HTTP caching) can significantly reduce load if most of your transactions are reads that apply to multiple users.

    --
    Bogtha Bogtha Bogtha
    1. Re:Graceful degradation usually fixes this by Buskaatt · · Score: 1

      For all we know the guy has a fallback in place. He just wants to know how to avoid having to use it. That's the thing about fallbacks, they're a fall. Back. Best only for worst case scenarios, and a good designer wants to plan for those scenarios, but also try to avoid them.

  14. Re:what are the specific problems? by Scott+Swezey · · Score: 1

    Is the issue your customers are having in the actual ajax, or is it just in some of the new javascript implemented. Some javascript (ie: moving a window off of the screen) requires "a signed script," which caused me a lot of trouble untill I figured that out. Also, if your ajax is trying to call a page on another domain (www.google.com and google.com are different, in the eyes of ajax, at least on my system), then that will likely create security issues.

    --
    Scott Swezey
  15. Re:what are the specific problems? by DahGhostfacedFiddlah · · Score: 1

    More importantly, Referer can be used to make sure users aren't coming from *other* sites, to prevent cross-site scripting. For example:

    http://www.your-site.com/do_action.php?action=dele te_all_my_stuff

    Check the referer. It's not your-site.com? Don't delete all my stuff.

  16. Re:what are the specific problems? by FLEB · · Score: 2, Funny

    With security like that, your stuff is so amazingly gone.

    --
    Information wants to be free.
    Entertainment wants to be paid.
    You just want to be cheap.
  17. Re:what are the specific problems? by Bogtha · · Score: 1

    No, that's a poor use of Referer. What happens when you have a blank Referer header? You can either ignore the request, which breaks things for people who have disabled that header, or you can go ahead with the request, which causes security problems for people who have disabled that header.

    Established best practice for avoiding attacks like this is to generate a random value tied to the user to be used as a hidden field in each legitimate form and check for valid values for each request.

    --
    Bogtha Bogtha Bogtha
  18. Re:what are the specific problems? by DahGhostfacedFiddlah · · Score: 1

    Good points - I've worked mostly with internal systems though, and never had any complaints from people who have referers turned off. It's not a common practice. Still - I'll use the method you describe in the future.

    It may not have been the "best practice", but it did keep my users safe, which is all I care about.

  19. Re:Generally, you work around the user's environme by XaXXon · · Score: 0

    If you're resorting to using AJAX only ameliorate your DB load, you may wish to try more conservative methods that will work on all client machines, such as optimizing your queries, first.

    Unless you can predict the future, you can't "optimize queries" to only get the data the user is going to want. Random crap advice of "optimize your queries" is worthless and unhelpful.

    Getting data on demand is how the web is going to work. I'd suggest you stick to the standards and the users will complain to the anti-virus makers. It's their job, too, to work in the user's environment. That includes sites that load content on demand.

  20. Re:what are the specific problems? by slackmaster2000 · · Score: 1

    You may have been lucky. Referer is set by the client, thus is trivial to spoof. Never rely on referer for any kind of security measure or request verification.

  21. Re:what are the specific problems? by DahGhostfacedFiddlah · · Score: 1

    This was just for XSS protection - to make sure links from other sites (mysite.com?delete_all_my_stuff) couldn't harm the client. If the client was sending anything other than the expected referer, they were redirected to a known safe page (home page). Sure they could spoof it, but why would they want to?

  22. If it's Norton Internet Security by Fencepost · · Score: 2, Insightful

    I suggest they replace it with something else. Almost anything else, really.

    Norton is the only thing I've ever seen decide that outbound DNS queries were *all* suspicious and should be silently blocked.

    --
    fencepost
    just a little off
  23. Re:Generally, you work around the user's environme by mabinogi · · Score: 1

    > Unless you can predict the future, you can't "optimize queries"
    Do you even know what he meant by "optimize queries"?

    The actual data retrieved by a client is pretty much irrelevant. It mostly doesn't matter which data the user is going to want. It only matters how they get the data. No (sane) web site allows visitors to run custom SQL queries, so therefore there are a limited number of queries that are performed. Each of those can be examined to determine whether or not they are being done in the most efficient way, or in a way that works best with their current load profile.

    Expecting your customers to complain to their Anti-Virus companies, and then wait for those companies to give the a fix(Ha!) sounds like an excellent way to not have any more customers.

    Here's a simple flow -

    1. Introduce new feature.
    2. Customers complain feature doesn't work.
    3. Try to fix feature.
    4. Did fix work? If yes, then go to 6.
    5. Fix didn't work, roll back new feature and search for an alternative way to solve the original problem.
    6. Profit!

    Your flow would be -
    1. Introduce new feature
    2. Customers complain feature doesn't work.
    3. Tell customers they're wrong.
    4. Tell customers they're still wrong.
    5. LALALALALALALAI CAN'T HEAR YOULALALALALALALA
    6. wonder where all the profit went...

    --
    Advanced users are users too!
  24. Re:what are the specific problems? by aminorex · · Score: 1

    Portable AJAX can only use the same host name, ip, and port (!), as the page the script was served from.

    --
    -I like my women like I like my tea: green-
  25. I don't get it... by Turmio · · Score: 2, Insightful

    ...why and how would "implementing AJAX" cause problems with your "security/privacy software such as Norton and McAfee". Can you please explain? As far as I know AJAX is is just a friendly word for technique where a web browser sends regular HTTP requests dynamically based on action the user performs using web based user interface so that certain aspects of the user interface change accordingly to the performed action without fully reloading the page. In what way would these kind of HTTP requests/responses be distinct from the requests the browser performs when initially loading the page and resources that are needed to render the page from the point of view of "security/privacy software"?

    And why do you think that "implementing AJAX" would magically reduce the load on database servers? The load on database server is purely dependant on the data you are storing and the queries you're doing in order to access it. Sure, you could be able to avoid certain queries hitting the database by firing the queries only after the user does something on the web interface. But on the other hand, this is not magic bullet for sure. If you don't know what you're trying, you might find yourself in a situation where your web and database servers are hammered with say 10x increase in requests/queries.

    1. Re:I don't get it... by mdfst13 · · Score: 2, Insightful

      If you click the google link, it gives examples. E.g. Norton Internet Security's ad blocking software blocks google. Cookie blocking software blocks the google cookie that it uses for persistence. I didn't read through the rest, but it's at http://mail.google.com/support/bin/topic.py?topic= 1523 if you want to know.

      In terms of AJAX reducing DB queries, it works as follows. In traditional web apps, you often have data that gets reloaded repeatedly. For example, a list of products. The user clicks on a product, looks at it, clicks back to the list (causing a db query on the page refresh). Now, in AJAX, the user clicks on a product, which hides the list. In place of the list the product details are shown. Clicking the link to the list hides the product details and shows the list (no page refresh so no db query). If your main use case is people clicking back and forth between pages (e.g. to compare products), then using AJAX significantly reduces the page hits.

      Others have pointed out that server side caching does the same thing (relative to the database). The problem comes when you have a lot of clients relative to the size of your server cache. Server caches work best when multiple clients can share a cache. In this situation, each client might be looking at different products, which causes thrash (there is more info than fits in the cache).

      Sure, you can write AJAX apps in such a way that they increase the DB load. AJAX is not magic; it won't auto-solve issues. However, AJAX can be used to rewrite an existing app to reduce page queries. The reduction in page queries will reduce DB load in many situations.

    2. Re:I don't get it... by nahdude812 · · Score: 1

      Even with "perfect" caching, in a traditional web app model, you still have to build the product list again (web server load), and you have to re-send all that data to the customer (network load). With a smart ajax application, when the user clicks back on the product list, they're shown the list immediately, without even a web request having to go out to your server.

      So even with the best possible server-side caching scenario set up, using ajax and related techniques to implement client-side caching can be even more effective.

  26. Re:what are the specific problems? by Jaruzel · · Score: 1

    Way to go! You've just guaranteed that the owners of your-site.com now have thousands of 404s in their web logs, with slashdot referers ;)

    -Jar.

    --
    Together, We Can Make Slashdot Better. I Do NOT Mod ACs. - Check Me Out
  27. Re:Generally, you work around the user's environme by XaXXon · · Score: 1

    Please don't quote me out of context.

    What I said was:

    Unless you can predict the future, you can't "optimize queries" to only get the data the user is going to want.

    It's very often that a website doesn't present all the data to the user that the user could request. Fetching the data on demand can result in database improvements that "optimized queries" can't touch because you don't even have to get the data often times.

    And yes, I do know what it means, I do it for a living.

  28. Re:Just stop using Ajax by nickovs · · Score: 4, Insightful

    Really, it was presumptuous of you to try to foist your server load problems off onto your clients. Yeh, Ajax has "buzz" and all, but to most people it's just damned stupid.

    This indicates a complete lack of understanding of why developers are turning to AJAX. The point is not that they want to foist their server load problems on the client. The point is that they are trying to give their users a more responsive experience. Reducing the burden on the server is one effective way to do this.

    When we were all on the far end of 14K4 modems, a few seconds of latency at the server went more or less unnoticed. Now that most of us have broadband, people complain if the information does not at least appear to arrive instantly. AJAX, when used properly (and I concede that it is not always used properly) is about having web sites that only move the change information back and forth, without moving all of every page when little has changed. This reduces the traffic between the client and server in both directions and can improve responsiveness as a result. Google Maps is a classic example of this; by moving the map tiles around locally in JavaScript and only asking the server for the missing tiles as they are needed makes for a much more interactive experience. The fact that the map tiles are all static content is a bonus, but it's not the end goal.

    --
    If intelligent life is too complex to evolve on its own, who designed God?
  29. Re:Simple. Let's take Slashdot moderation as... by dalroth5 · · Score: 1

    In the case of Slashdot moderation, I think you're forgetting something. Working through a page of comments, reading each one, and assessing whether the existing moderation seems fair and accurate takes a significant amount of time. In that time it is entirely likely that others have also moderated the same page.

    I'm sure that all moderators will have been caught at least once by seeing a particular comment end up with an inappropriate score as a result. Conscientious moderators will probably then decide that when moderating, they should reload frequently.

    I think that that is exactly the right thing to do; and that is what I _would_ do...except that I don't have to because the /. developers have made it unnecessary by invoking the full reload you describe.

    If the page were served as you are suggesting, all that would happen is that I would immediately reload the entire page manually; and my action taken with your partial AJAX reload would add up to _more_ traffic, not less.

    --
    "We reject kings, presidents and voting. We believe in rough consensus and running code." Dave Clark, IETF
  30. Re:Simple. Let's take Slashdot moderation as... by mdfst13 · · Score: 1

    1. If we were going to do /. moderation in AJAX, we might change how it worked. Instead of modding an existing score up or down, you'd vote for what you think the true score is. Since this wouldn't be dependent on the existing score, you wouldn't need to refresh anything.

    2. The time when you want to reload the page isn't *after* you've moderated, it's before. I.e. refreshing the page after you moderate only helps you for the next moderation, not the current moderation. AJAX could offer you a button that refreshed the moderation for just that post (actually, come to think of it, clicking on the post would be enough; generally you should be looking to moderate posts that show only the headline). A really small request/response. AJAX would also allow a popup that says "Hey, moderation changed here; did you really want this to be a +4? Or are you happy at +3?" A strictly better solution than reloading the entire page, as it takes away the race condition.

    3. Even with the existing system, you don't necessarily need to refresh the page. What you want to do is refresh the changes. I.e. get all the moderations and new posts; leave all the existing posts.

    It's certainly possible to implement AJAX in ways that are less efficient than the non-AJAX solution. However, properly implemented, AJAX will reduce database load because it does two things: remember previous state and allow one to load changes (to the previous state).

  31. if its ActiveX that's a no, fall back on IFrame? by acroyear · · Score: 1

    If getting ActiveX controls to work is a problem, you could fall back on loading your results by javascripting into an IFrame. Granted, its much more difficult to implement "POST" handlers that way, but with the right library, most of those differences can be hidden away. The main thing you lose is the automatic XML parsing - but if using Ajax as an RPC mechanism, you should try using JSON instead. The Javascript DOM implementation ain't the greatest.

    --
    "But remember, most lynch mobs aren't this nice." (H.Simpson)
    -- Joe
  32. Funny/Informative, Flash by arete · · Score: 1

    parent, I wish I could mod you "Funny/Informative Satire" For those people who can't reverse your satire:

    It is relatively difficult to add more database servers. It is relatively easy to add more webservers. Any caching structure you could possibly use in AJAX you could definitely use on your webserver - and many more, because you have power over those servers.

    You MIGHT use AJAX to reduce the load on your webserver in some cases, but if it reduces load on your DB server you didn't have caching setup right. Generally you use AJAX for a better user experience.

    I want to take this opportunity to mention Flash as an alternative. Certainly it has been abused, but over the last few years Actionscript (used in Flash and Flex) has become a full fledged OOP language. It is ideal for these sorts of applications, precisely because the results you get on one platform or browser are identical to the ones you get on another one, in Windows, OSX or Linux (i386) It has the highest installed userbase of any software in use by web users (higher than IE, because it's also installed on non-IE browsers) Applications without a lot of GUI can be quite small. A significant part of my living is creating database driven Flash/Flex apps.

    The AJAX alternative would seem to be to use some kind of AJAX framework that abstracted the differences away for you. Offhand I can't recall a specific one, but I've seen a couple.

    --
    Looking for freelance Actionscript (Flash/Flex) or ColdFusion work and/or freelance developers. Email me, put Slashdot
  33. Re:what are the specific problems? by DahGhostfacedFiddlah · · Score: 1

    Good. Hate those guys.

  34. Let Us Think About This by LifesABeach · · Score: 1

    My first thought was, "You use Microsoft." AJAX is HTML, CSS, Javascript, XML, and XLST. One can throw in a sprinkle of "XMLHttpRequest "; But by appling KISS, one will find XMLHttpRequest is at best, redundent. The reader should at this point start to notice that this is all Client Side handling; Basically, the Server spoon feeds the Client. If one ponders how to talk to the Server, consider the POST, and GET options for a <form ...> tag? If one wonders about those who would listen, consider the use of the HTTPS protocol.

    As for the Server side of this reply, consider the following quote, "Regular Expression Your Inputs, Build Your Outputs."

    If one needs Security solutions; Is buying from a Marketing company the best merchant?

    I've seen alot from Microsoft about security problems with AJAX; But no examples. Without examples to support these concerns, this is FUD.

  35. Are you retrieving cross-site content? by hackmare · · Score: 1

    This comment will only be relevant if I guessed your intent from your problem definition.

    When you say you are using Ajax to lighten your DB load, it implies might be using Ajax to request content from other servers than the source server your content comes from (cross-site scripting).

    If that is the case, you can certainly expect your clients' antivirus systems to (rightfully) give you a headache.

    You simply should not be doing that, and until something like http://json.org/JSONRequestJSONRequest (proposed for inclusion into ECMASCript core)is implemented in Ajax in an acceptable, core way, then you should stay far away from cross-site functionality. Go through a proxying solution to handle off-site content vian agents on your server.

    --
    -- ronan at roasp.com roasp.com
  36. Stick with lightweight dynamic html... by mengel · · Score: 1
    If instead of going for full-blown AJAX, you just do some simple dynamic html tricks, like hiding/unhiding various sections of the page, you can in many cases get a very responsive pages, without going back to the server so often. For example, going back to the list of items from the specific item detail can be simply changing the style to hidden and back on two different page elements. Ditto for browsing hierarcies (folder/subfolder, etc.) -- you can make a static html list of the fully unfolded hierarchy, and use dynamic html trics to unfold the parts of the list the user is interested in seeing.

    Of course, without more details on what you're trying to do, it's hard to be more specific. But you can do a lot without storing cookies, running ActiveX bits, etc.

    --
    - "History shows again and again how nature points out the folly of men" -- Blue Oyster Cult, 'Godzilla'
  37. I want to know... by /dev/trash · · Score: 1

    How AJAX reduced DB load.

    Enlighten us.

  38. XForms route by leighklotz · · Score: 1

    At my work, we've chosen the XForms route using Chiba for a recent product. It's not that surprising that I use it, because I was one of the editors of the 1.0 spec a long time ago, but it progressed even in my absence ;-) and it does fit many of the needs people describe here, in particular security and accessibility.

    We write our dynamic markup in XHTML+XForms, following W3C standards (including nascent accessibility standards), and then use Chiba server-side in Tomcat to translate it into HTML4 and JavaScript. Chiba also offers a translation to HTML4 with a "refresh" button to initiate the dynamic activity via plain old HTTP, so it's fully accessible, though not as dynamic.

    Longer term, please check out the Mozilla XForms XPI, which will take the XHTML+XForms markup directly. The browser does all its security stuff already, and it follows the IETF HTTP RFC and other W3C specs directly, so there's no need for funky workarounds or security lifting. The Firefox implementation is at rev 0.5 or 0.6 about now, and it's definitely usable, but when it gets to 1.0 it will be really great for dynamic behavior.

    There are other implementations as well, FormFaces, which is written entirely in JavaScript and is way cool, FormsPlayer for IE, with lots of advanced features and which is a plugin, not a native implementation (as in the Firefox one); X-Smiles, the open source standalone implementation from Finland, SolidApp, another OSS one with paid support for small devices (mobile phone vendors look here), PicoForms, also for embedded apps but not OSS, Orbeon, a complete back-end server solution incorporating XForms and pipelines. I'm sure there's more major implementations I've missed, and also partial ones as well.

    If you want to know more check out the XForms FAQ and XForms or HTML authors Part 1 and Part 2.

    Plus, Will Wheaton likes it.

  39. Bad link by leighklotz · · Score: 1

    ...please check out the Mozilla XForms...

  40. Ajax a Feature? by Anonymous Coward · · Score: 0

    Ajax isn't a emerging feature, it's a garish hack to further extend html into doing things directly contrary to what it's good at. Yet another prime example of hype run amok.

  41. use the AJAX! by lo_fye · · Score: 1

    I don't think many of the people who commented here have actually used AJAX. One person's complaint was "Explain to me how creating more HTTP requests by using AJAX is going to decrease your database load." The answer is two part: 1) It decreases overall load & bandwidth used by reducing the number of full pages sent. Not having to re-render a page significantly reduces the number of queries required; 2) It reduces database load in particular by running a greater number of low-load/complexity queries, instead of a lesser number of high-load/complexity queries (joins). I've never personally had my Norton or Avast prevent me from doing any AJAX. In fact, I've never even heard of this, and I've done a lot of AJAX and a lot of cross-browser testing. It's "just another request" as far as the browser is concerned. Are you talking about the flag Internet Explorer raises when you use AJAX to request "off site" content? (i.e., using AJAX to request data from a domain different from the one on which the javascript is hosted). There is a *very* simple workaround for this. The solution is to route remote AJAX requests through a local request forwarder. All it does is receive your AJAX request, and forward the request. You get the result back via your request forwarder. Voila!

    --
    geeks are cats who dig a certain kind of cool