Showing posts with label Bugs. Show all posts
Showing posts with label Bugs. Show all posts

Wednesday, May 8, 2019

RA21's recommended technical approach is broken by emerging browser privacy features


This is my third comment about the recently published NISO draft "Recommended Practice" (RP) on "Improved Access to Institutionally-Provided Information Resources" a. k. a. "Resource Access in the 21st Century" (RA21). Official comments can be submitted until May 17th.  My first comment concerned the use of secure communication channels. The second looked at potential phishing attacks on the proposed system. I'm posting the comments here so you can easily comment.

RA21's recommended technical approach is broken by emerging browser privacy features

Third party cookies are widely on the web used as trackers, or "web bugs", by advertising networks wishing to target users with advertising on the web. The impact of these trackers on privacy has been widely reported and decried. Browser local storage deployed using 3rd-party iframes is similarly employed for user tracking by ad networks. Browser vendors, led by Apple, have fought back against user tracking by providing user options to limit third party information sharing. Apple's "Intelligent Tracking Protection"  has progressively increased the barriers to cross-site information storage, for example, by partitioning the local storage according to third-party context.

Unfortunately for RA21, the draft recommended practice (RP) has endorsed a technical approach which mirrors the tactics used for user tracking by the advertising industry. For this reason, users of Safari who choose to enable the "prevent cross-site tracking" option may not benefit from the "seamless" access promised by RA21 if implemented with the endorsed technical approach.

Wikimedia commons
The optimistically acronymed "P3W" pilot used a javascript library called "Krakenjs/zoid" (According to the Norse sagas, the kraken is a squidlike monster that terrorizes voyagers) to exchange data between cross-domain contexts. The limitations on krakenjs in Safari are acknowledged by the library's developer.  It works by having the host webpage create an iframe loaded from a P3W website. With privacy controls off, the web page posts to the iframe, which answers with a reference to the user's identity provider. The service provider website uses that information to help the user authenticate without having to search through a huge list of identity providers. With Safari privacy features turned on, the search process must be repeated for each and every service provider domain.

Other browser vendors have moved towards restricting tracking behaviour. Firefox has announced that it will phase in "enhanced tracking protection"
Even Google's Chrome browser is moving towards restrictions on tracking technologies.

The bottom line is that if RA21 is implemented with the recommended technical approach, library users will probably be required to turn off privacy enhancing features of their browser software to use resources in their library. As a result, RA21 will have difficulty moving forward with community consensus on this technical approach.

Browser software is much more tolerant of cross-domain communication when the information "hub" is a first-party context (i.e. a window of its own, not an embedded iframe), as is done in more established authentication schemes such as OpenID Connect and SAML flow. RA21 should refocus its development effort on these technical approaches.

Update July 5, 2019:

RA21's official response to this comment is:
Future work includes storage policy notification. Also, we are not actually using third party cookies even though this term is often used to describe several cross-domain access patterns; instead, RA21 recommends using web storage (aka, browser local storage) together with HTML5 post-message for cross-domain access. This is the same mechanism (and indeed the same implementation) that PayPal uses, thus demonstrating broad browser support. A description of web storage has been added to the Terminology section. We are aware that by turning off "third party cookies" it is possible for the user to partly or completely disable the call to action button but in those cases the user experience degrades gracefully to a classical SAML/OpenIDC discovery flow.
Essentially the same response was made to three other submitted comments. Two of them, from Duke's Tim McGeary, called out two sections of the recommended practice and noted:
Word of caution: this login specifically cannot happen in an iFrame to meet SSO security protocol
The third, from Cornell University Library, submitted by Adam Chandler, amplified on McGeary:
Comment from Cornell University Library Privacy as a Service Working Group. Our group includes membership drawn from Library IT, Library Licensing, Library Public Services, Cornell IT Security, and Cornell Privacy Office.

Under 2.4.: We agree with Tim McGreary's comment (#862 or #863 - seems that he double-posted it) that the SSO login shouldn't be inside a frame on another page. There are security issues with that kind of approach. The users can't see the login page URL to verify that the page is a x.uni.edu page before entering their passwords, so it makes it easier to spoof the login page. Generally, login pages use "framebusting" to prevent this kind of possibility.
RA21's response on this issue is alarming, and suggests that the whole project is in danger of failure. RA21 seems to be unaware that using HTML5 web storage is worse than 3rd party cookies in many respects - particularly privacy and security. Currently, only Safari defaults to "a classical SAML/OpenIDC discovery flow", but that still means that if they want to be accurate, they'll have to rename the implementing organization "The Coalition for Seamless Access but Not on iOS" or "The Coalition for Problematic Access".

I hope that the beta implementation will be executed by a team with the experience and competence to override or at least effectively mitigate RA21's technical blunder.

Sunday, July 12, 2015

The Library Digital Privacy Pledge

I've been busy since my last post! We've created the Free Ebook Foundation, which will be the home for Unglue.it and GITenberg. I helped with the NISO "Consensus Framework to Support Patron Privacy in Digital Library and Information Systems", which I'll write more about soon. And some coding.


But I've also become a volunteer for the Library Freedom Project, run by radical librarian Alison Macrina. The project I'm working on is the "Library Digital Privacy Pledge."

The Library Digital Privacy Pledge is a result of discussions on several listservs about how libraries and the many organizations that serve libraries could work cooperatively to (putting it bluntly) start getting our shit together with regard to patron privacy.

I've talked to a lot of people about privacy in digital libraries, and there's remarkable unity about its importance. There's also a lot of confusion about some basic web privacy technology, like HTTPS. My view is that HTTPS sets a foundation for all the other privacy work that needs doing in libraries.

Someone asked me why I'm so passionate about working on this. After a bit of thought, I realized that the one thing that gives me the most satisfaction in my professional life is eliminating bugs. I hate bugs. Using HTTP for library services is a bug.

The draft of the Library Digital Privacy Pledge is open for comment and improvement  for a few more weeks. We want all sorts of stakeholders to have  a chance to improve it. The current text (July 12, 2015) is as follows: 

The Library Digital Privacy Pledge of 2015

The Library Freedom Project is inviting the library community - libraries, vendors that serve libraries, and membership organizations - to sign the "Library Digital Privacy Pledge of 2015". For this first pledge, we're focusing on the use of HTTPS to deliver library services and the information resources offered by libraries. Building a culture of library digital privacy will not end with this 2015 pledge, but committing to this first modest step together will begin a process that won't turn back.  We aim to gather momentum and raise awareness with this pledge; and will develop similar pledges in the future as appropriate to advance digital privacy practices for library patrons.
We focus on HTTPS as a first step because of its timeliness. At the end of July the Let's Encrypt initiative of the Electronic Frontier Foundation will launch a new certificate infrastructure that will remove much of the cost and technical difficulty involved in the implementation of HTTPS, with general availability scheduled for September. Due to a heightened concern about digital surveillance, many prominent internet companies, such as Google, Twitter, and Facebook, have moved their services exclusively to HTTPS rather than relying on unencrypted HTTP connections. The White House has issued a directive that all government websites must move their services to HTTPS by the end of 2016. We believe that libraries must also make this change, lest they be viewed as technology and privacy laggards, and dishonor their proud history of protecting reader privacy.
The 3rd article of the American Library Association Code of Ethics sets a broad objective:
We protect each library user's right to privacy and confidentiality with respect to information sought or received and resources consulted, borrowed, acquired or transmitted.


It's not always clear how to interpret this broad mandate, especially when the everything is done on the internet. However, one principle of implementation should be clear and uncontroversial:
Library services and resources should be delivered, whenever practical, over channels that are immune to eavesdropping.
The current best practice dictated by this principle is as following:
Libraries and vendors that serve libraries and library patrons, should require HTTPS for all services and resources delivered via the web.

The Pledge for Libraries:

1. All web services and resources that this library directly controls will use HTTPS by the end of 2015.
2. Starting in 2016, this library will not sign or renew any contracts for web services or information resources that do not commit to use HTTPS by the end of 2016.

The Pledge for Service Providers (Publishers and Vendors):

1. All web services that we (the signatories) control will enable HTTPS by the end of 2015.
2. All web services that we (the signatories) offer will require HTTPS by the end of 2016.

The Pledge for Membership Organizations:

1. All web services that this organization directly controls will use HTTPS by the end of 2015.
2. We encourage our members to support and sign the appropriate version of the pledge.

Schedule:

This document will be open for discussion and modification until finalized by July 27, 2015. The finalized pledge will be published on the website of the Library Freedom Project. We expect a number of discussions to take place at the Annual Conference of the American Library Association and associated meetings.
The Library Freedom Project will broadly solicit signatures from libraries, vendors and publishers.
In September, in coordination with the Let's Encrypt project, the list of charter signatories will be made announced and broadly publicized to popular media.

FAQ

Q: What is HTTPS and what do we need to implement it?
A: When you use the web, your browser software communicates with a server computer through the internet. The messages back and forth pass through a series of computers (network nodes) that work together to pass messages. Depending on where you and the server are, there might be 5 computers in that chain, or there might be 50, each possibly owned by a different service provider. When a website uses HTTP, the content of these messages is open to inspection by each intermediate computer- like a postcard sent through the postal system, as well as by any other computer that shares a network those computers. If you’re connecting to the internet over wifi in a coffee shop, everyone else in the coffee shop can see the messages, too.


When a website uses HTTPS, the messages between your browser software and the server are encrypted so that none of the intermediate  network nodes can see the content of the messages. It’s like sending sealed envelopes through the postal system.


Your web site and other library services may be sending sensitive patron data across the internet: often bar codes and passwords, but sometimes also catalog searches, patron names, contact information, and reading records. This kind of data ought to be inside a sealed envelope, not exposed on a postcard.


Most web server software supports HTTPS, but to implement it, you’ll need to get a certificate signed by a recognized authority. The certificate is used to verify that you are who you say you are. Certificates have added cost to HTTPS, but the Electronic Frontier Foundation is implementing a certificate authority that will give out certificates at no charge. To find out more, go to Let’s Encrypt.


Q: Why the focus on HTTPS?
A: We think this issue should not be controversial and is relatively easy to explain. Libraries understand that circulation information can’t be sent to patron on postcards. Publishers don’t want their content scooped up by unauthorized entities. Service providers don’t want to betray the trust of their customers.
Q. How can my library/organization/company add our names to the list of signatories?
A. Email us at pledge@libraryfreedomproject.org. Please give us contact info so we can verify your participation.
Q. Is this the same as HTTPS Everywhere?
A. No, that's a browser plug-in which enforces use of HTTPS.
Q. My Library won't be able to meet the implementation deadline. Can we add our name to the list once we've completed implementation?
A. Yes.
Q. A local school uses an internet filter that blocks https websites to meet legal requirements. Can we sign the pledge and continue to serve them?
A. Most of the filtering solutions include options that will whitelist important services. Work with the school in question to implement a work-around.


Q. What else can I read about libraries using HTTPS?
A. The Electronic Frontier Foundation has published What Every Librarian Needs to Know About HTTPS
Q. How do I know if I have implemented HTTPS correctly?
A. The developers behind the “Let’s Encrypt” initiative are ensuring that best practices are used in setting up the HTTPS configuration.  If you are deploying HTTPS on your own, we encourage you to use the Qualys SSL Labs SSL Server Test service to review the performance of your implementation.  You should strive for at least a “B” rating with no major security vulnerabilities identified in the scan.


Q. Our library subscribes to over 200 databases only a fraction of them currently delivered via https. We might be able to say we will not sign new contracts but the renewal requirement could be difficult for an academic library like ours. Can we sign the pledge?
A. No one is going to penalize libraries that aren’t able to comply 100% with their pledge. One way to satisfy the ethical imperatives of the pledge would be to clearly label for users the small number of insecure library resources that remain after 2016 as being subject to surveillance.


Q. I/We can contribute to the effort in a way that isn’t covered well by the pledges. Can I add another pledge?

A. We want to keep this simple, but we welcome your support. email us with your individualized statement, and we may include it on our website when signatories are announced.

Tuesday, May 14, 2013

Hack the Publishing Hackathon

Why a publishing hackathon?
Book discovery needs innovation. It’s never been easier to get a book into a reader’s hands—just one click. But, with over 10,000 books published each year on every topic imaginable, how do people find out about them? There are fewer bookstores to help readers discover exciting new authors and ideas. There’s currently no digital experience that replicates the serendipity of browsing bookshelves. Recommendation engines are fairly primitive – they know what you bought, but they don’t know why. It’s a disruptive opportunity that hasn’t been explored.
Seriously, the sponsors of this event don't think book discovery has been explored? I guess they were too busy suing Mr. Google to notice that Google Books is a pretty good discovery tool. I suppose they never thought to ask Mr. Wikipedia how many books are published every year.

All in all, I find the description of this hackathon INSULTING to just about every developer that's worked in the general vicinity of the book industry.

Umm. Mr. Steinberger. If you and Perseus really want to promote discovery innovation, then perhaps you have heard of Goodreads? They're driving some decent discovery of books. Maybe it doesn't count if Mr. Amazon is buying them. Perhaps you've heard of Amazon? They popularized the "If you liked this, maybe you'll like..." feature that everyone in the publishing industry tries to copy. If you don't like Goodreads, maybe I can introduce you to LibraryThing, which has been driving valuable book discovery in more ways than I can list here. I know that "library" in their name is a big turnoff for your big 6 colleagues, but libraries are huge book discovery machines. I don't suppose you want them to disrupt anything. And umm DP.LA????

People mostly discover books by word of mouth. Some  innovators promoting social reading include Readmill (who had their own publishing hackathon) and (giving props to the NYC home team) ReadSocial and the stuff Bob Stein has been exploring. And Kobo, Copia and Zola are doing some amazing things to integrate book discovery with ebook selling and reading environments. I've written previously about Jellybooks' fresh approach to discovery.

And some more on libraries. When I was at OCLC, we worked on real simple problems like "how do you discover the other editions of the same book?" and we found that publishers had NO CLUE what they'd published 5 years previous. So yeah, we did our bit.

But I'm coming to the hackathon anyway. because despite the ridiculous framing, this event has some clueful backers. NYPL for one. Small Demons for two. And they're even wasting prize money on a new age library metadata thingy. (I might be wrong about the wasting part.)

I'm hoping that some people will be interested in rethinking ebook front matter. Unglue.it needs books to work better all by themselves. The best discovery instrument for a book is the GDMF book, to my mind. So let the book do some work. With a little javascript. And no more DRM, thank you very much!
Enhanced by Zemanta

Thursday, March 14, 2013

Twitter Bots are Getting Stranger

I like to see what people are saying about Unglue.it, so I follow the "unglue" tweetstream. For many months, the false positives were really quite entertaining. In the words of normal human twitterers, the word "unglue" unearths all sorts of things people are stuck to and want to be unstuck. Lips, asses, couches, various electronic devices, and of course, Twitter itself. And combinations of two or more of these sticky things. Fun times!

The first bot butting in on my "unglue" stream belonged to some sort of travel agency social marketing bot named Leadify. Various destinations were being touted by this bot under by different users:
@SkyRunTelluride Can’t unglue the kids from the tv on vacations? Go camping in Telluride and leave technology behind.
@VisitGatlinburg Can’t unglue the kids from the tv on vacations? Go camping in Gatlinburg and leave technology behind.
@CrestedButteMt Can’t unglue the kids from the tv on vacations? Go camping in Crested Butte and leave technology behind.
@TimberlineVaca Can’t unglue the kids from the tv on vacations? Go camping in Breckenridge and leave technology behind.
@lodgingdeals Can’t unglue the kids from the tv on vacations? Go camping in Snowmass and leave technology behind.
@vailmountain Can’t unglue the kids from the tv on vacations? Go camping in Vail and leave technology behind.
You get the idea. At least it's clear what "service" this bot is providing.

But recently, a new bot has started getting in on the "unglue" action. What bugs me is I can't figure out why it does what it does:

@IsabellaMariah3 Unglue latent clubhouse derby: .cpP
@MervinSacco1 Unglue official pass250 607-109 audition check over guides: .BCO http://bit.ly/ZMz6fj
@MacDonaldBoswor Dancery unglue rounders online: .Fhi
@ClarenceWither1 Charley 95010 online until unglue straight a rich conjunction unripe forethink: .daw http://bit.ly/WckiGL
@GoldmanLarry1 Unglue fund online casinos: .pyT 525471
@IsaacShade1 Unglue swop 185-113 prelim niagara mopes: .AQb http://bit.ly/10OwHmW
@AllenHoffmann1 Unglue pos software - baksheesh in preference to forthright pos software, guides with acquit pos software: .hFg http://bit.ly/Xv9k0W
@BootmanRussel1 Betting parlor online unglue green stuff extant professional athlete bribe: .YnL 050623
@PassBobby Unglue liquid assets repudiation cash upon be unfaithful online poolroom: .mNG 263810
@GladysSavannah Current unglue contribute nonobservance stationing show biz: .Obd
@EricksonCarter Tavern unglue do tool motion hiatus: .wrm 894279
@JohnsonAllison2 Amusement park unglue participate: .Sby 584823
@BarnesIsabelle Flat reputable volume dvd unglue: .QfH 362486
@JustinCharlie1 261 sporting house unglue tropez aggrandize: .cln
@FrederickWilli4 The hard-and-fast fender in relation with unglue online auction: .RqZ http://bit.ly/Xr2Tw3
@AlanLindley2 How head an neutral advisor grant-in-aid myself pick the uppermost glamour issue unglue racket: .mcY http://bit.ly/W8lrz9
@PaigeCarol1 Thereupon the album's unglue, the belt stirred drummer chouse health resort but salaried nicholas dingley, go ... 121898
@PaigeSandra1 Theater bootlegging unglue surface structure: .nxz 968560
@MiloVelasquez1 332 gambling hall unglue online volutation: .otR
@PeregrinBoles Unglue downloadlot-054exam chamber music guides: .qxf http://bit.ly/10KfJGp
@LeapmanRebecca Entertainment industry unglue contract bridge toad: .iyG 836459
@MakaylaCooper15 Cafe chantant coupon unglue gamut: .eqG 184945
What could possibly be the purpose of these tweets?

My first thought was this is some SEO scam. About 1/3 of the tweets have a bit.ly link to the http://promotion-web.tk/ or related websites; these pages contain more nonsense text under the title "First-class portal". (The "dot .tk" top level domain is a free domain registry based in Amsterdam) But that doesn't make much sense. Why would nonsense tweets point at nonsense websites? And why would most of the tweets come without links?

And if it's an SEO scam, why add things like ".nxz 968560"? Who's going to click on a tweet like that? Even search engines aren't that dumb.

My next thought was that these accounts are those "followers" that social marketing bozos buy for their twitter feeds. But no, many of these these accounts aren't following more than two or three other accounts, though they may have 250 or so of their fellow robots following them, along with a surprising number of apparently human social media consultants.

It's puzzling, and I don't take kindly to unsolved puzzles. This army of zombie twitter accounts must be assembling for some sort of mischief.

So here's my best guess. I think these twitter bots are hiding information in plain view. Suppose you were a terrorist organization or a criminal network, and you needed to publish communications to large numbers of people world wide. What better way to do this than to publish encrypted information on twitter. Or even better, put the encrypted information on a network of websites, and use a distributed network of twitter accounts to distribute the decryption keys? Or maybe this is where Wikileaks is storing its secret files.

The data publishing rate appears to be about 100 tweets per minute, or about 230 bytes/sec. That's 20 MBytes per day. Maybe the three letter codes are the intended recipients, and the 6 digit numbers are constantly changing keys (like RSA's SecurID) for files posted on 2-factor secured websites.

Or maybe its just garbage ungluing latent clubhouse derby.

Notes:
1. Just to be clear, it's not just the word "unglue" that zombie bot is attacking.
2. I can't wait to get head-desked by a simple explanation in the comments.
3. So you don't have to try one of those bitly links yourself, heres a sample of text from one of the garbage websites:
Oneabe is a free online bidding site offering best auctions and known as beat penny auction site , here we conduct Free Online Auction and oneabe is one of the best Online Auction Sites. We also offer free international auction. Presently we are bidding on thunder-Quadband Dual SIM Wifi Touchscreen World and on superb LCD Home theatre media projector and so on. We do our auctions category wise. As here you would see a plethora of options and catalogs within which you can choose whatever is of your choice and need and participate in bidding as well as can buy them. We offer categories like Antiques and art, automobile & bikes, survival kits, businesses for sale, clothing and accessories, coins and collectibles and much more. We are known as a penny auction site worldwide.Under the category of antique and art we offer 20th century antiques ranging from 1920’s till modern , architectural antiques like garden antiques and others, under the wing of Art we offer contemporary art, drawings, paintings, general, photographic images, prints as well as sculptures. We also sell books and manuscripts those are rare and precious. We offer a plethora of ceramic goods and also clocks, decorative items to decorate your home and your office. Our folk art is very unique and our foreign arts are all master pieces. We also do bidding on furniture, map or atlas as well as on metal ware such as brass, copper, bronze, gold, silver, and silver plated goods also we sell music instruments. We also offer here to our customers a very good quality of textiles and linens that includes fabric, embroidery, linens and quilts and much more. Under the gaming option we offer...
4. (update) More theories being discussed on Hacker News https://news.ycombinator.com/item?id=5373161 
Enhanced by Zemanta

Friday, January 25, 2013

The Four Crimes of Aaron Swartz (#aaronswnyc part 2)


The law is such an idiot when it comes to the internet. You can hardly expect better, since it was written in prehistoric times and is being maintained by people who lack many clues. And so to discuss crime and Aaron Swartz, it's useful to distance ourselves from definitions of crime that involve legality. There's a lot happening on the internet that's completely legal and very criminal, and there's also rampant illegality that should't be considered a crime.

Crime is really about upsetting or undermining a social construct. Stealing violates our social construct of property. Assault, murder, or hurting people in any way violates our mutual compact to live and let live. Social constructs vary in their utility and their generality. The most broadly useful get codified into laws. Some of the others do, too. When circumstances change, some of the social constructs need to be set aside and new ones constructed.

We're left with moral calculus. Here's my definition of moral calculus: it's anything you can't explain to an 8 year old about right and wrong, because the 8 year old isn't corrupt enough to believe it. It's an adult's set of excuses for doing or not doing the right thing. We need these excuses because our world is imperfect.

My first conversation with Aaron Swartz had me playing a "good cop" role. I needed to explain to Aaron how some of his mass-downloading was getting people really upset and could have negative consequences for the things he was trying to accomplish. If he would just ask, I told him, he could have an account for an API that DIDN'T crash to smithereens when asked for millions of records. And people were working really hard to make the information he wanted free, it just needed some years to make sure the machinery wouldn't collapse. Aaron sounded embarrassed. I sounded embarrassed.

I told him stories about I had once crashed Harvard's library system while doing some tiny little tests. Was that a crime? It wasn't MY bug. Maybe Harvard lost use of its catalog for a few hours in the middle of the night was that such a big deal?

I've also fixed crashes in the middle of the night. Believe me, you don't feel very charitable about the idiots who attack your system. The IP addresses usually say they're from Russia or India or China, but 99% of the time they're bots looking for something you don't have, so you make sure your system is robust enough to deal with some nasty tickles, and you go home and sleep soundly.

And apparently that's what happened to the folks at JSTOR when Aaron started his systematic downloading aimed at them.

So let me tell you a bit about JSTOR. JSTOR is a non-profit organization whose mission is to make scholarly information available in digital form, not just today, but into the future. And they do what they do very well. Almost too well. I had a business developing hyperlinking technology for libraries. The links to JSTOR worked quite well. There was no crashing of THEIR system when I reverse-engineered it. But they also took a legal stance that in order to link to them you had to have a legal agreement. I thought it was dumb, but they insisted on rigorous testing of my links before officially letting my system link to theirs. The result was better linking that benefitted everyone.

JSTOR's business model is to charge subscription fees to libraries to enable access to the articles they've digitized. Part of the fees are passed to their journal-publishing partners. And they make assurances to the partners that the intellectual property rights in these journals will be not be compromised. Their nightmare is that some third-world hacker will download all the technical articles and make them available in regions where it might be difficult for JSTOR and their publishing partners to assert their copyrights.

So of course JSTOR noticed Aaron's downloading articles and blocked the IP address he was using. Most likely that block affected lots of other people. And they contacted the MIT library to find the source of the mass downloading. Dealing with this kind of thing would have been a routine matter for both JSTOR and MIT Library. It's a common occurrence that someone acquires a proxy-server password from a friend and proceeds to download some journal they need for their research someplace that can't afford its own deluxe JSTOR subscription. So Aaron's first crime in the JSTOR affair was that his actions resulted in the loss of access to JSTOR for some part of the MIT community and loss of productivity at JSTOR and MIT Library. That's inconsiderate, but not illegal. Both MIT and JSTOR had legal obligations to do what they did. Aaron was just using guest access at MIT, so he wasn't bound by any institutional terms of service. And his robot wasn't reading JSTOR's website terms and condition.

Aaron didn't stop his downloading when MIT and JSTOR cut him off, alas. I think he was having too much fun eluding his pursuers. He didn't have to do anything terribly sophisticated, but it would have driven the network administrators crazy. There's nothing worse than having a hidden agent on your computer or on your network. Because even if it's not going anywhere it's not allowed to go, if you don't know where it is or what it's doing, you suspect the worst. You start doubting everything, and everyone, and you can lose your sanity. So that was Aaron's second crime. Diving people crazy via self-doubt is a crime in my book. But not illegal.

But why the reasonably good non-profit JSTOR? Why not attack Elsevier or some other for-alotta-profit publisher? My guess that Aaron's interest in JSTOR was its trove of public-domain articles. Once he had possession of the public domain articles, Aaron could commit a perfectly legal crime. He could distribute the digitized public-domain articles on the internet, for free. Executing a hack of the legal code was in character for Aaron, he had done it successfully with PACER.

While it's most likely legal, "liberating" JSTOR's public domain collection would be Aaron's crime number three, because it undermines an accepted social construct. It doesn't seem wrong to me for JSTOR to recover its digitization and distribution costs by charging willing customers for access. But there's an opposing argument that this information is part of our heritage and that it's immoral to deny people access to information they need, just because you're poor or you don't have connections to a fancy institution of higher learning, or you live in a country that struggles with subsistence or because you're only 13 years old. Those who build on the public domain have a special obligation to respect Tim O'Reilly's "create more value than you capture" rule.

It seems that JSTOR has accepted to moral burden of this argument. It's taken important steps to make its public domain corpus available to everyone. The great thing about moral calculus is that you can change it.

The fourth and final crime of Aaron Swartz was to commit suicide. That's the crime we're most angry about.

My last conversation with Aaron Swartz was at the SOPA protest in Manhattan a year ago. I congratulated him on the fruits of his activism. I told him about Unglue.it and our plans to make ebooks free to the world with crowdfunding. He loved the idea, and made me promise to let him know how it went. It's going ok, Aaron, but we could really use some help.

OK Go's @damienkulash sings at #aaronswnyc
CC BY-NC-SA by Schwartzray

Enhanced by Zemanta

Saturday, October 2, 2010

A Web Developer's Approach to Bedbugs

I hate bugs. It used to be that if I became aware of a problem or vulnerability in the software I was responsible for, or if I noticed something in the application I didn't understand, I wouldn't be able to sleep until the culprit was isolated and squashed. The thought of users encountering a known bug gave me an terrible feeling, and the thought that a hacker on the other side of the globe might be exploiting my system was my worst nightmare.

In its second year of operation, my previous business had two of its servers hacked into. In retrospect, it was a good thing to happen to us. Our customers never noticed the problem, but we got security religion real fast. We became meticulous in patch application, kept our servers clean as a whistle, and monitored the logs regularly. Our servers stayed up for the next 7 years through terrorist attacks of 9/11 and the blackout of '03.

When you do web development and service deployment, you quickly learn that any device open to the internet is being constantly probed for vulnerabilities. You become familiar with all the ways your server is listening for connections and the sort of threats that are out there. You EXPECT that sooner or later, any vulnerability will find attackers, even if an attack would be completely pointless. It's as if bank robbers went door-to-door breaking and entering, just in case your house happened to be a bank.

Consider spam. Spammers don't care that you're an English speaker with no interest in penile implants. They'll still send you emails about them in Greek. They'll even do it with every submit button you put on the web, and they'll leave inane comments on your baby blog. If there's habitat that can support spam, spam will somehow evolve to fill that habitat.

Bedbugs are exactly the same.

When I opened my eyes one morning this summer to the sight of a flat brown bug crawling on my pillow, I didn't freak out- I applied lessons I had learned doing web development and deployment. But I had a lot to learn about bedbugs.

If you've been at all sentient this summer you will have read one or more news articles about the bug that is devouring New York City. I've read all these articles and they're mostly useless. The web was more informative, but less so than you might think. It takes at most 2 Google searches to find useful information almost any web security threat based on its attack vector, but search for bedbug information, and most of what you get are people trying to sell you ineffective solutions to your bedbug problem. Some mainstream media outlets illustrated their bed bug article with a picture of a shield bug. Thank goodness for Wikipedia! Their photos allowed me to identify my bug as a genuine adult bedbug.

Who's afraid of a little brown bug? There's never just one bug. I learned that bedbugs are extremely good at hiding, but you can detect their presence by things they leave around: bites marks in twos or threes, a few mm apart, and little balls of excrement that leave smeary black spots near their hiding places. The bites I had been wondering about, but the bedbug feces I hadn't noticed. Examination of my bed turned up some black spots on the fabric holding the slats together, and I was hot on the trail. I disassembled the bed and found a bunch of bed bugs in a the recessed holes of two of the screw heads holding the bed together. To date, I've found about 30 bugs; I keep them in a double zip-lock plastic bag, the better to study them. Am I a nerd or what?

At a certain point in dealing with bedbugs, paranoia sets in. They are so clever in their ability to hide, you begin to assume they are everywhere. And then you start feeling bugs crawling over you at night. One very useful fact helped me deal with this. It turns out that bedbugs have evolved the ability to crawl on your skin so that you can't feel it. If you feel something crawling on your skin, you can be pretty sure it's not a bedbug. Unless its a bedbug who's just tanked up and is heavy with a load of your blood, and then it's too late. Take a look at the long feet the big bedbug in my picture has- they're designed for stealthy crawling.

By the way, the pictures are taken with a cheap USB microscope that I got on Amazon. Best nerd toy ever! Works with Photobooth on my MacBook Pro. Hey, Christmas isn't that far off!

The USB microscope allowed me to confirm that the tiny things crawling around my kid's beds weren't bedbugs. In my paranoia, I started using an LED flashlight to highlight dust on the floor, and noticed that some of the dust was crawling around. I'm pretty sure these crawling bits of dust are "booklice". Booklice aren't really lice, they're tiny insects also called psocids. Booklice feed on mold that grows on damp plaster (yep, we got that) and glue such as found on book bindings. (Another advantage of ebooks!)

Bed bugs are quite hardy. They last at least a month in my plastic zip-lock bag, and they are resistant to pesticides. DDT resistant strains were observed even in the 1950's

I'm currently living in an apartment while our house is being renovated. When we move back in, we'll be very careful to take only items that we're sure can be trusted. It will be just like rebuilding a hacked computer system. You have to start with something you know for sure is clean, something you can trust, because a otherwise you can't rule out a rootkit. I'm now careful to clean out my vacuum cleaner after every use, and I stow it in a giant zip-lock bag.

For now, though, my study of bed bugs has led me to the conclusion that getting rid of the bugs is just a first step. If you have a server that gets hacked, it does you no good to rebuild the system unless you identify the weakness your attacker exploited. If you don't, the attack will happen again, and you'll be back where you started from. Same with bedbugs. So I've started thinking of my bedroom and its maintenance as a system for sleeping that, for the foreseeable future, will be under continual attack from parasitic blood sucking invaders. Knowledge of the invader's life cycle should help me to design maintainable defenses against the attack.

Most of the news media have focused attention on how to avoid "getting" bedbugs, as if they're a disease. But given how difficult it is for a layperson to detect a bedbug infestation, my guess is that for most people, low-level exposure to bedbugs will be almost unavoidable. Even if you stop sitting in the comfy couches at Starbucks, hanging out in the library, and watching movies in dark theaters, you won't avoid some amount of bedbug exposure.

Think of bedbugs the same way you think of computer viruses. A surefire way to avoid them is to stop using the internet and email, but that's not what most of us do. We deal with computer viruses and similar attacks by avoiding risky behavior and vulnerable software, and by keeping our systems clean and uncluttered. Or don't, as the case may be.

What are the measures that will keep the bedbugs from biting? Some knowledge of the bedbug's life-cycle can provide some insight into our sleeping system's vulnerabilities.

Let's start with the adult bedbug. It feeds at night, and after a full meal, it's sluggish and easy to catch (and to smush into a bloodstain on your sheet or wall). It can go weeks without a meal in its hiding place, and lays eggs where they can hatch and find a meal. The newborn bedbug nymph locates a host the same way a mosquito does- sensing heat and CO2. Nymphs are hard to see, almost transparent, until they have a drink. Then they find a dark place to hide when the sun comes up. The bedbug grows through six stages of development, shedding a skin at each stage.

The ideal habitat for a bedbug is a dark hiding place with an easy commute to dinner. In retrospect, the flaw in my sleeping system was that it provided plenty of idyllic bedbug habitat. I have a platform bed that has a closed space under the bed slats. You can't clean under the bed without removing the mattress and unscrewing the slats. The slats and the frame have all sorts of crevices that must have been a cozy retirement home for great grandpa bedbugs. The highest concentration of resting bedbugs I found was an screw hole a short 18 inch crawl from my shoulder. Other locations reputed to be favorites of bedbugs include electrical outlets, cracks in the floor, and "popcorn" ceilings.

I've eliminated as much of this habitat as possible. The mattress is encased in a mite-proof cover, even though it showed no sighs of infestation. I've filled cracks and I've eliminated clutter from neat my bed. I've put a lot of stuff in sealable plastic bags.

A new weekly cleaning regimen has been instituted for my sleeping system. Every Saturday morning, I run the sheets through the wash and heat the quilt in the dryer. I take apart the bed frame and vacuum, dust, and mop around and under the bed. I snoop around with the flashlight for any signs of bedbugs or their feces. So far this seems to have worked well. I've seen only 2 bedbugs in the last two months.

When we move back into our house, the platform bed frame will get trashed. A new bed will have legs and feet, to better isolate my sleeping area from the floor and to make it easier to clean regularly. When more bedbugs try to hack into my sleeping system, they will not find any cosy hideouts.

And Mom was right. We all need to make our beds every day.

Some resources I found to be useful and/or interesting:

Locating and eliminating bedbugs takes expertise; if you can find a reliable and knowledgeable pest control professional, money you spend on them will not be wasted. But be aware that the explosion of concern about this nuisance created the ideal "habitat" for scam artists and hucksters selling crap.

Wednesday, April 28, 2010

Pick this Nit: Null Path URIs and the Pedantic Web

There is no surer way to flush out software bugs and configuration errors than to do a sales demo. The process not only exposes the problem, but also sears into the psyche of the demonstrator an irrational desire to see the problem eradicated from the face of the earth, no matter the cost or consequences.
Here's a configuration problem I once found while demonstrating software to a potential customer:
Many library information services can be configured with the base URL for the institution's OpenURL server. The information service then constructs links by appending "?" and a query string onto the base URL. So for example, if the base URL is
http://example.edu/links
and the query string is
isbn=9780393072235&title=The+Big+Short ,
the constructed URL is
http://example.edu/links?isbn=9780393072235&title=The+Big+Short.
For the demo, we had configured the base URL to be very short: http://example.edu, so the constructed URL would have been http://example.edu?isbn=9780393072235&title=The+Big+Short. Everything worked fine when we tested beforehand. For the customer demo, however, we used the customer's computer, which was running some Windows version of Internet Explorer that we hadn't tested, and none of the links worked. Internet Explorer had this wonderful error page that made it seem as if our software had broken the entire web. Luckily, breaking the entire web was not uncommon at the time, and I was able to navigate to a different demo site and make it appear is if I had fixed the entire web, so we managed to make the sale anyway.
It turns out that http URLs with null paths aren't allowed to have query strings. You wouldn't know it if you looked at the W3C documentation for URIs, which is WRONG, but you will see it if you look at the IETF specs, which have jurisdiction (see RFC 1738 and RFC 2616).
Internet Explorer was just implementing the spec, ignoring the possibility that someone might ignore or misinterpret it. The fact that Netscape worked where IE failed could be considered a bug or a feature, but most users probably considered Netscape's acceptance of illegal URLs to be a feature.
I still feel a remnant of  pain every time I see a pathless URL with a query string. Most recently, I saw a whole bunch of them on the thing-described-by site and sent a nit-picky e-mail to the site's developer, and was extremely pleased when he fixed them. (Expeditious error fixing will be richly rewarded in the hereafter.) I've come to recognize, however, that a vast majority of these errors will never be fixed or even noticed, and maybe that's even a good thing.
Nit picking appears to have been a highlight of the Linked Data on the Web Meeting in Raleigh, NC yesterday, which I've followed via Twitter. If you enjoy tales of nerdy data disasters or wonky metadata mischief, you simply must peruse the slides from Andreas Harth's talk (1.8M, pdf) on "Weaving the Pedantic Web". If you're serious about understanding real-world challenges for the Semantic Web, once you've stopped laughing or crying at the slides you should also read the corresponding paper (pdf, 415K ). Harth's co-authors are Aidan Hogan, Alexandre Passant, Stefan Decker, and Axel Polleres from DERI.
The DERI team has studied the incidence of various errors made by publishers of Linked Data "in the wild". Not so surprisingly, they find a lot of problems. For example, they find that 14.3% of triples in the wild use an undeclared property and 8.1% of the triples use an undeclared class. Imagine if a quarter of all sentences published on the web used words that weren't in the dictionary, and you'd have a sense of what that means. 4.7% of typed literals were "ill-typed". If 5% of the numbers in the phone book had the wrong number of digits, you'd probably look for another phone book.
They've even found ways that seemingly innocuous statements can have serious repercussions. It turns out that it's possible to "hijack" a metadata schema, and induce a trillion bad triples with a single Web Ontology Language (OWL) assertion.
Nit Free Terminator Lice Comb, Professional Stainless Steel Louse and Nit Comb for Head Lice Treatment, Removes NitsTo do battle with the enemy of badly published Linked Data, the DERI team urges community involvement in a support group that has been formed to help publishers fix their data. The "Pedantic Web" has 137 members already. This is a very positive and necessary effort. But they should realize that the correct data cause is a hopeless one. The vast majority of potential data publishers really don't care about correctness, especially when some of the mistakes can be so subtle. What they care about is accomplishing specific goals. The users of my linking software only cared that the links worked. HTML authors mostly care only that the web page looks right. Users of Facebook or Google RDFa will only care that the Like buttons or Rich Snippets work, and the fact that the schemas for these things either don't exist in machine readable form or are wildly inconsistent with the documentation is a Big Whoop.
Until of course, somebody does a sales demo, and the entire web crashes.
(nit and head louse photos from Wikimedia Commons)
Enhanced by Zemanta

Friday, December 4, 2009

My Funnest Bugfix Ever: the Double Relative Redirect

Intel has been running an ad called "Our Jokes Aren't Like Your Jokes". In it, an actor portrays Mario Paniccia, Director of Intel's Photonics Technology Lab mischievously altering an equation on a futuristic see-through noteboard. Hilarity ensues.



There's a lot to remark on here. In what sense is the actor portraying Mario Paniccia? In what way is this ad promoting Intel's corporate image? Can you believe that I'm putting it on my blog, totally without get paid for it?

The ad is hilarious because many of us recognize the truth it expresses. The very best geek humor is funny exactly because so few can appreciate it.

I am now going to attempt to detail the funnest bug I ever found. I've encountered less than ten people in the world who have understood it, and of those, only a few could laugh, because the others were complicit.

Five years ago, one of my linking technology company's users, a librarian-customer who was quite adept technically, had noticed that the links we were providing for one publisher were "flaky", and wondered if we could do anything about it. Our first two layers of support had trouble reproducing the problem, but they agreed that there was something flaky about the links, and they had a high regard for the librarian in question, so the problem got escalated to me (in a small company, even the President should be part of the customer support team). As it turned out, I had configured the link in question myself a year or two earlier, and I had a vague recollection that there was some hard-to-put-your-finger-on flakiness with it. So I started poking around.

The linking technologist's most important tool is a Firefox plugin called LiveHTTPHeaders. It lets you see how your browser is communicating with web servers. When I ran this tool, I immediately saw the problem. The links being sent to this publishers were being routed through a redirection chain. The first stage of the chain converted metadata-based links to database key links and set a session cookie. The next and final stage turned the key link into the actual content link for the user. The problem was that both of these redirects failed to comply with the W3C standard for HTTP redirects.

When a link is embeddded in a web page, it can be one of two types, relative or absolute. An absolute link uses a fully spelled out address, like http://go-to-hellman.blogspot.com/2009/09/redirector-chain-mashup-design-pattern.html. A relative link specifies the address of the link target relative to the current address. So, from this page, the same address could be written in relative form as /2009/09/redirector-chain-mashup-design-pattern.html. The browser has to do some computation to figure out the expanded address from a relative link.

The problem with the flaky links was that the server was sending back relative links in the redirect. Although you can do that in a web page, it's not allowed in the HTTP standard for the server. The most popular web server software, Apache, won't even permit a web developer to send a relative link; in fact, it will helpfully do the expansion calculation automatically. Our flaky link, however, was being served by Microsoft's IIS server software, which doesn't do the expansion. It's possible that the bug arose when a web application designed for Apache was deployed in IIS.

Although I could see where the problem was coming from, and I could see that our linking software was thankfully not to blame, I was thoroughly puzzled. Why did the link only seem flaky, instead of just failing? The answer must lie in the client software- the bits of code on the user's computer that talks to the server.

It's usually a good idea when implementing a communications protocol to be strict about what you send and forgiving about what you receive. So when a relative address is received by an http client, it tries its best to recover from the error. It goes and gets the most recent address it's received and uses that to expand the relative address into an absolute address. So, in the vast majority of cases, users don't experience a problem when a server sends a relative redirect to their browser.

The flaky link problem I was looking at resulted in link failure because the server was sending two relative links in a row. The first link could get expanded just fine, but the second link only had a relative address to expand against, resulting in complete failure of the link.

How could a problem like this have escaped notice? And here we have the geek punch line: the expanded address gets put in the redirect cache! So the second time the user clicks on the link, the initial address is found in the cache, and the first relative redirect is skipped over. Only the second relative redirect is performed, and this time there's a full address from the cache to expand against, and the link works as intended.

If you are an HTTP geek of any sort, you can get up off the floor and stop laughing already. If you are not, read on, and I'll try to explain why it is truly hilarious.

Once I figured this bug out, I did some digging. I found that the same thing was happening not only for the OpenURL links that my software made for linking within a librairy, but also for CrossRef DOI links, which are used pervasively for linking between publishers. I determined that it was not just one publisher that had the problem, it was every publisher that used the same e-journal hosting service. There were about a thousand e-journals affected. And it had been that way for at least a year. My guess is that this link failure had frustrated users at least a million times.

Ninety nine times out of a hundred, the user would just try clicking the link again, and wouldn't think twice about the problem. But that other 1% (10,000 users) would ask a Local Expert for help- perhaps a librarian, perhaps a more-tech savvy friend, whatever. The Local Expert would extend her aura over the user's computer, the user would try it again, and the link would work like a charm.

Ninety nine times out of a hundred, the Local Expert would just smile, having "solved" the problem. But 1% of them (100) would smell something fishy, and ask the user to try another link, and it would fail. The local expert would go back to her desk, and try it a few more times, getting more and more mystified at the flakiness of the link, and decide to report it to a Responsible Party.

Ninety nine times out of those hundred, the Responsible Parties would, for a variety of reasons, fail to do anything about the flaky links. Maybe it was another company's problem. Maybe the problem was too hard, or not bad enough. Maybe they didn't really care.

The hundredth time, it was me. I actually enjoyed finding the bug. I knew the top technical guy at the e-journal hosting company, and I just sent him a description of the issue. Because he knew me, he paid attention, and the problem was fixed in their next update. Millions and millions of the links have worked since.

Isn't that hilarious?