Skip to content

fix(rules): sec-hardcoded-url flags the canonical apache.org URLs inside an unmodified Apache-2.0 LICENSE file #719

Closed

Description

@ajianaz

Cora version

0.20.0

Which command?

cora review (diff review with the deterministic rules).

What happened?

A pull request that adds a copy of the standard Apache-2.0 LICENSE file (byte-identical to the repository-root file) got a BLOCKED verdict with two MAJOR findings:

[MAJOR] rule: crates/<name>/LICENSE:4
  [sec-hardcoded-url] Insecure HTTP URL detected (not https). Use HTTPS for all external connections.
[MAJOR] rule: crates/<name>/LICENSE:185
  [sec-hardcoded-url] (same)

Both lines are the canonical http://www.apache.org/licenses/ and http://www.apache.org/licenses/LICENSE-2.0 URLs inside the license text. They are not connections the code makes, and the text cannot be changed to https without altering the license. The file was already in the repository root; only the new copy in the crate (needed so the license ships in a published crate) was flagged, because the rule scans added lines.

What did you expect to happen?

URL rules skip well-known license and notice files (LICENSE*, COPYING*, NOTICE*, *.license), or recognise SPDX license texts. A repository can still opt in with a rule override.

Steps to reproduce

  1. Copy an unmodified Apache-2.0 LICENSE into a subdirectory on a new branch.
  2. Run cora review --base <default branch>.

Logs / output

See above.

Config (if relevant)

Default rules. In the affected repository the finding was accepted as a documented false positive and no config was changed. Tracking issue: codecoradev/tole#670.

Before submitting

  • I searched existing issues and didn't find a duplicate

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:lowscope:core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions