Block access to .scss, .sass, .less, .pcss and .pcss.css files

Created on 28 December 2020, over 3 years ago
Updated 9 May 2024, about 2 months ago

Problem/Motivation

SASS preprocessor is widely used for Drupal theming. That means many Drupal projects keep their styles in scss files. As these files are used only for compiling CSS files there is no need to keep them publicly accessible. Furthermore themers can use silent comments // to keep sensible information in the scss files so that it may be considered as a security issue.

.sass is a valid sass file extension, see https://sass-lang.com/documentation/syntax. Meanwhile, .less is a similar one (e.g. Less is used in Bootstrap 3)

Steps to reproduce

Create some scss file in your theme directory and visit the following URL.
https://example.com/themes/THEME_NAME/scss/SOME_FILE.scss

Proposed resolution

Update .htaccess and web.config to block access to scss, .sass, .less, .pcss and .pcss.css files

Remaining tasks

Discuss. Create a patch.

User interface changes

No

API changes

No

Data model changes

Release notes snippet

Drupal's generated .htaccess file has been updated to disallow viewing of scss, .sass, .less, .pcss and .pcss.css files

📌 Task
Status

Needs work

Version

11.0 🔥

Component
Asset library 

Last updated about 3 hours ago

No maintainer
Created by

🇷🇺Russia Chi

Live updates comments and jobs are added and updated live.
  • Security

    It is used for security vulnerabilities which do not need a security advisory. For example, security issues in projects which do not have security advisory coverage, or forward-porting a change already disclosed in a security advisory. See Drupal’s security advisory policy for details. Be careful publicly disclosing security vulnerabilities! Use the “Report a security vulnerability” link in the project page’s sidebar. See how to report a security issue for details.

  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024