Yes, it is a security issue.
The included JavaScript runs in the context of your website, which means that it has control over anything that you would have control over.
External JavaScript files can harm you by among other:
- read cookies (eg to steal sessions)
- read user input (eg to read password inputs)
- change what the user sees (eg to display ads, phishing, defacing)
- execute forms as the user (eg to change the users information, to send out spam to other users)
- perform requests to other servers (eg to send the obtained information to the attackers server, to perform DOS/bruteforce attacks on other servers, etc)
So you should only include external JavaScript files if:
- you trust the domain / company from which you include not to harm you
- you trust them to keep their server secure
- you use HTTPS for the include to avoid man in the middle attacks
There are of course also upsides to including JavaScript from an external server:
- the load on your server will be reduces
- the user might already have that file cached, so the website will load faster for your users.