Caution over copycat 3rd party integrations

I published a safe read only Trading 212 integration last week, i'd been working on it locally for some time, it started as a complicated NodeRed flow; a few days later another appeared, fully polished and submitted to HACS and HA...
That's all fine, if a little suspiciou, but the Github account is brand new, and there is only one public repo, a Trading 212 repo...

If you are building or using custom integrations that require API tokens, especially for financial services, please be careful.

watch for:

  • a very new GitHub account or organisation

  • little or no visible project history

  • one or two highly polished public repositories appearing suddenly

  • broad feature claims from day one

  • polished README, screenshots, release notes and companion cards

  • an integration asking users to enter API credentials

None of that proves anything malicious. New developers are welcome, and AI-assisted development is clearly here to stay.

But it should raise the level of scrutiny.

A Home Assistant custom integration is not just a harmless dashboard add-on. It is code running inside your Home Assistant environment. If it asks for an API token, that token is only as safe as the code handling it.

For financial integrations in particular, users should check:

  1. Does the integration clearly state it is read-only?

  2. Does the external service allow API tokens to be restricted to read-only access?

  3. Are users explicitly told to create a read-only token only?

  4. Does the code make outbound calls only to the expected API?

  5. Are tokens excluded from logs, diagnostics and issue templates?

  6. Is the maintainer/project history credible?

  7. Are there unnecessary companion cards, telemetry, or external services involved?

  8. Is the entity model controlled, or does it create a huge number of entities by default?

  9. Does the project have clear releases, changelogs and issue handling?

  10. Has anyone technically reviewed the code?

The risk is simple: if a user accidentally creates a token with more access than needed, a bad integration could potentially expose that token or account data. That does not mean every new project is dangerous. It means credential-handling projects need more care.

For developers, my lesson learned is also simple:

  • keep early work private until it is mature

  • do not publish detailed roadmaps too early

  • document your security model clearly

  • state exactly what the integration does and does not do

  • avoid mutation/write endpoints unless absolutely necessary

  • make read-only token guidance prominent

  • avoid logging secrets or sensitive account data

  • make your project trustworthy, not just feature-rich

AI can now produce a very polished-looking copy integration quickly. That makes trust, provenance, reviewability and security posture more important than ever.

Use custom integrations, build custom integrations, but do not treat a polished README as proof of safety.

Franck Nijhof as a maintainer of HACS, please can you look into these two PR's. Mine is under dougle03. I'm not saying there is anything wrong with the later submission, but it certainly looks very fishy...

You raise valid concerns that will grow increasingly difficult to quash. Is Home automation the correct platform for financial and security information to be stored? The current answer is a resounding NO!

The initial code may easily pass scrutiny, but will any updates, especially if they have external links to obscure code and are queued for automatic update?

Hence the 'hey folks, I vibe coded this. I take no responsibility for it and will not answer any support questions' one post wonders should be quickly moderated to oblivion, or closely scrutinised. Who has the skills to do this on a voluntary basis? Who controls it once it hits GitHub, regardless if it is removed from here?

I'm just waiting for the Bitcoin wallet add-on app. Whatever could go wrong?

Basically the same issue with all these 'new' just 'hook it up' Instant AI agents for HA.

It is an ever increasing problem with a lot of oss code right now unfortunately. You have to be extremely careful and if you're a repo owner then doubly so, the bad guys want your repo compromised... So they can compromise others.

If anyone asks you to hook up a black box to HA 'trust me bro' style and it's black box code. it's basically the same attack surface.

Supply chain attack attempts will continue to grow as more and more code is controlled by AI Dev. It will be a fact of lielfe now like don't hook a machine without A to bare internet unless you like getting pwned.

Read the repo before you download...

Once a bad guy has program attic access to your HA (including by MCP in most cases.) You're toast.. I can exfil your api keys tokens etc. ND I BET most people have keys for at least one sensitive surface. Inside HA.

Because ha has a shared memory space.. Once bad code is in. It Pwns the box. Caution is warranted.

Twenty years ago we connected a freshly installed Windows computer direct to the Internet, no added firewalls or protections installed, just the standard vanilla CDROM install from the hardware vendor, watched and waited with robust monitoring tools active.

Six minutes to active compromise. Repeatable. Twenty years ago.

You haven't got a hope these days, with state actors harnessing late version AI to find and actively deploy attacks. You can only hope they find you an unattractive target and move elsewhere.

Six. Man that was long. Me and a couple guys at work did this experiment in 2013 (2012 maybe) 1.1500 sec. Completely compromised. (and yes I remember the timing we were all stunned we all had 10+ seconds on the sheet.)

We had dialup connection. We watched it in real time being typed, probably by hand or cut and paste scripts. These days with gigabit connections the norm, one shudders how quickly you can scan entire continents in a short period of time using tools like Shodan.

What riles me is if you stumble across a compromised system and give them a heads up, they get upset at you.

Not always. When you get a "Thank you, We didn't know. We'll get right on it." it feels really good.

HomeAssistant, as one of the most popular GitHub offerings must be so vulnerable and attractive to attack.
Feed some popular code into a LLM, ask it to merge your malicious code and post a PR, and sit back and wait. Any wannabe skript kiddie can do this.

When was the last time you clicked on the first link Google offered you? We have, due to poor experience with sponsored links, learnt to pause and consider before clicking. The time to do the same with AI assisted code is here.

Do you read the release notes and examine the source diff code for each release? Should you? Should you have to? Does that mean the compiled code you are downloading is a true reflection of the source code? Is there enough time in the day to do this, or enough tokens available for your trusted AI assistant to do this routinely, within your budget? Who to trust?

@dougle03 have you done a diff on the other code? Is the code similar? Is the algorithms the same? Is it a derivative work, a knockoff, or an original idea coincidentally released at the same time, great minds thinking alike? Thanks for starting an important discussion and outing the big oss elephant that is becoming harder to ignore.

LLMs are excellent plagiarism machines - by design. They slurp up, repackage and confidentally regurgitate information they scan, [sadly, often as slop and wrong]. Are you and the other person the victim of this? Pending a valid rebuttal by the other person, I would kindly and magnanimously hope this is the case.

There's a reason I haven't made my project python and a HA integration. It would get copied and compromised within a week.

I worry the AI engines, using your code and algorithms as a template, may offer a similar solution to a competitor to appear suitably empowered. Like KPMG in the news right now, using insider knowledge for competitive advantage.
You are willingly giving away the keys to your kingdom to something that says trust me, and (annoyingly) paying for the privilege to do so to train it and tune its' algorithms. How to verify? Who [what] to trust?

The stuff I'm doing is already knows I'm just arranging it in a safe useful way. Yes someone could copy the style but good luck using the jinja code. :rofl: That's what makes it too complicated and costly to direct port rn. I don't have some of the things they want to compromise a box... On purpose.

But yes it's a real problem.

I suspect 99% of these new hey just put in a key here. Are some kind of collection malware.

My biggest concern is one we don't have control on mostly upstream compromise of a well known library that is part of HACS integrations.

Bump your way to compromised

Security by obscurity doesn't work any more when you can just teach the AI engine a new coding language within seconds.

Self awareness comes when it starts to reject deliberate mistakes designed to out such nefarious activity to detect this at work.

Raiiling against AI and burying our collective heads in the sand won't work either, the steam roller having already gathered unstoppable pace. Legislative constraints probably won't work too well either.

"We'll all be rooned said Hanrahan" sums it up well. A great Aussie poet... I was just reading that Kati Thanda-Lake Eyre is nearly full, but sorry to digress.

No it doesn't - and its too technical to get into here but there are very specific functions you cannot do in Jinja that make using my stuff next to impossible to compromise a box. If you're interested DM - but Yeah - that's not an issue.

The A#1 threat rn (and to OSS in general tbh unfortunately) is the silent upstream supply chain attack.

Some one ever compromises aiohttp - we're all SKREWD!

aiohttp? You mean npm? Naah, they wouldn't dare.

Did they?

Things like that are the current targets. No not known to be compromised and sorry if I gave that impression but it and all the other big stuff like it... ABSOLUTELY that's the target. 100%

Imagine what happens if they compromise something like THAT.

Repo owners need to guard their keys with their life. I moved mine to a hardware supported passkey.

I'm looking at all Github sourced code with a fine-tooth comb before I hit enter on git pull.

You running a SuperMicro motherboard or updating your Ethernet NIC driver firmware? That is when it gets difficult not to look over your shoulder frequently.

Wait till Linus retires and we have to update the HomeAssistant core. Will you blithely hit the update button?

Ignorance can often be bliss. The burden of knowledge starts way back in the Garden of Eden with that wicked snake and an apple...

Was it a Python? Smirks.

IOT7712 Thanks for requesting to hear my side of things. I wasn't sure how to reach out to mods without creating a second (which I know is not right given I was kicked out already but I wasn't sure on how else to get my side across)

I've been reading this thread and there is a lot of good points.

On the security - Doesn't matter if it's AI or not AI we should all always do some level of audit before we install projects, granted with AI if the developer is lazy there's bigger chance that he might have missed something important. For me personally when it comes to financial stuff I don't mind having that info in my home assistant however as read only (which is what this project was meant to be).

On the plagiarisation issue, the code is not a copy, if there are any similarities between them its the same similarities that any of our integration projects have together in which we make API calls, fetch some data and save them to something such as a sensor. The version I had built and published was more feature rich at the point of go live. That wouldn't have been the case if I just pointed AI at Peter's project and told it to copy it. The way I started my journey on this was I had a script that exported my data from Trading212 as a JSON which I then used to manually push to AI to do analysis on give me insights, When I decided to do this through home assistant (a few weeks ago) there was no projects live that did what I needed. Perhaps its an oversight on my part that I didn't do a second check before publishing.

On the use of AI, It's a double edged sword. It can be very dangerous in the hands of someone that doesn't know what they are doing. However I believe the way we should be using AI is to allow us to accelerate what we do rather than take over for us. I use AI heavily in all my projects personal and professional but nothing makes it in to production without my own review. I put up guardrails to ensure what it's building is to high standards, automated tests for everything, I get it to scrutinise its own code and work on a feedback loop, I set up tooling like Playwright and give it access to run its own copy of HA and do installations of what its building to catch any bugs. None of these replaces the checks I do my self however it does speed up what I do massively.

I welcome you all to have a look at the code of the project and scrutinise it if need be, it's the only way any project such of this can improve over time.

Now on the venting out bit, I'm a little disappointed on how this whole thing has gone, Peter originally sent a message on my post, to which I responded respectfully and tried to open a dialog to which the response was that my project is a security threat. The only reason I published this project is because I thought it would be useful for others. If people want to use it / not use it that's fine with me. I'm still building new features into it that I find useful myself and hopefully others will too.

Show us your verified commits that genuinely date back to before mine was released? Better still, make your dev repo public so we can see you didn't just ask AI to copy, rewrite (to throw of plagiarism claims).
Equally, you've said you have been a dev for over 15 years, yet your gh account is brand new, as is your HA forum account... All very very suspicious.. It's as though you were born 5 days ago...

Hey,

So i've uploaded a few stuff to help show you how I came to do this project.
I've added screenshots here GitHub - sepehrs/screenshots · GitHub this forum won't let me share too many links or images

  • A link to the oldest public repo I've set up
  • Screenshots showing oldest contribution on github (previously I was on bit bucket as they allowed for more private repos back in the day)

github1.png
github2.png

  • Screenshots showing exports I had done from trading212 APIs to feed into claude to get some insight

claude1.jpg

  • Screenshots showing dates date/times of the trading212 scripts I had locally (never committed to git) to pull data before I decided to do full automation

claude2.jpg

  • Evidence of when my home assistant was set up (although I've been on home assistant much longer - this set up is just for my current house) - Look at .cloud (showing 2023)

ha1.jpg

  • Not thrilled about sharing personal information but a link to my linkedin showing when I started my development career (out of date since i've been in constant employment and not had a need to update it)

look me up on linkedin sepehrsabbagh

If it helps with my credibility I'm actually head of engineering now with multiple teams (roughly 20 developers, devops, qa etc reporting to me).

  • Reason why i've not had a account on HA community was because I never had something to post before.

If you really want to see if it copied your repo or not, I recommend installing something like claude code, instructing to build this integration - either explicitly tell it to ignore our repos / not mention them all.

What it will do is read trading212 docs, read HA docs, work out best practices and come up with something very similar. (similar to what any human will do - just faster).

I hope this is enough, like I said before I honestly was not trying to copy your project, was not trying to be malicious in anyway. Just built something that I thought was going to be useful for others and thought I'd share it.

I've tried to provide you with everything you asked for, review it, have a go at using AI and seeing what it will come up with. Once you done all that let me know what you'd like me to do - if you want me to take down my integration I can make my repo private and just use it for myself.