Skip to content

An asset cannot be read from a location outside the project configuration 1.6.0 #8783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eromano opened this issue Dec 7, 2017 · 7 comments
Labels
area: @angular-devkit/build-angular feature Issue that requests a new feature needs: investigation Requires some digging to determine if action is needed
Milestone

Comments

@eromano
Copy link

eromano commented Dec 7, 2017

Versions

1.6.0

Repro steps

  • Create a project
  • Configure the .angular-cli.json to Read a file from a parent folder

Observed behavior

Load file from an external folder now fails because of this check :

An asset cannot be read from a location outside the project

Introduced by the PR:

64c6031#diff-9eb0a75e499bdadd44d6dc62218812b8

could be possible introduce a parameter configuration as allowOutsideOutDir but for reading? something like :

 "allowOutsideReadDir": true 

It could be false by default and be enabled by the user only when he knows the security risk behind this kind of decision.

Side note the warning message could be improved indicating the assets failing

Desired behavior

Mention any other details that might be useful (optional)

If the idea above are ok for the project I could create a PR

@eromano eromano changed the title An asset cannot be read from a location outside the project configuration An asset cannot be read from a location outside the project configuration 1.6.0 Dec 7, 2017
@tleveque23
Copy link

Was working on 1.6.4, but since the new 1.6.5 it is failing again!

@trendzetter
Copy link

Not sure if this is related but it is a somewhat similar #8613 (comment)

@dotansimha
Copy link

dotansimha commented Feb 13, 2018

Same here. tried 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.7.3 :(

@Facius
Copy link

Facius commented Feb 16, 2018

Same here on 1.70, worked with 1.50

  "assets": [
    {
      "glob": "**/*",
      "input": "./../../fonts/",
      "output": "./assets",
      "allowOutsideOutDir": true
    }
  ]

@lazysergey
Copy link

any workarounds for this?

@filipesilva filipesilva added area: @angular-devkit/build-angular target: major This PR is targeted for the next major release labels Oct 8, 2019
@ngbot ngbot bot modified the milestone: needsTriage Oct 8, 2019
@filipesilva filipesilva added feature Issue that requests a new feature and removed target: major This PR is targeted for the next major release labels Oct 8, 2019
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Oct 8, 2019
@kyliau kyliau added area: etc/misc triage #1 needs: investigation Requires some digging to determine if action is needed and removed area: etc/misc labels May 26, 2020
@alan-agius4
Copy link
Collaborator

Closing as this is working as intended.

Files cannot be read outside of the workspace root directory as there is also a potential security concern. Especially now that deploying the application is possible via a ng deploy.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular-devkit/build-angular feature Issue that requests a new feature needs: investigation Requires some digging to determine if action is needed
Projects
None yet
Development

No branches or pull requests

10 participants